From 19cbbb2bec84f442cbffbc4cb6351b8dd59d9cc8 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 28 Dec 2015 18:12:45 +0100 Subject: [PATCH 1/4] Changed: Don't create log.log anymore --HG-- branch : develop --- code/ryzom/client/src/client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index a312c3978..7b4b185fe 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -371,7 +371,8 @@ int main(int argc, char **argv) DisableNLDebug = true; #endif - createDebug(); + // don't create log.log anymore because client.log is used + createDebug(NULL, false); INelContext::getInstance().setWindowedApplication(true); From 4c0fc6074fd5f2c2f03a6fd49157711cadc32930 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 28 Dec 2015 18:13:37 +0100 Subject: [PATCH 2/4] Fixed: Set process name (fixes the under Linux and OS X) --HG-- branch : develop --- code/ryzom/client/src/client.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 7b4b185fe..1c5476b39 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -545,6 +545,9 @@ int main(int argc, char **argv) strcpy(filename, argv[0]); + // set process name for logs + CLog::setProcessName(filename); + // ignore signal SIGPIPE generated by libwww signal(SIGPIPE, sigHandler); From 91f291302668c72eb4a86cce2c82049e600558ed Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 28 Dec 2015 18:15:28 +0100 Subject: [PATCH 3/4] Changed: Don't need to use std::stringstream --HG-- branch : develop --- code/nel/src/misc/report.cpp | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/code/nel/src/misc/report.cpp b/code/nel/src/misc/report.cpp index ef3280ef5..bad97c845 100644 --- a/code/nel/src/misc/report.cpp +++ b/code/nel/src/misc/report.cpp @@ -80,12 +80,8 @@ TReportResult report(const std::string &title, const std::string &subject, const std::string reportPath; if (!body.empty()) { - std::stringstream reportFile; - reportFile << getLogDirectory(); - reportFile << "nel_report_"; - reportFile << (int)time(NULL); - reportFile << ".log"; - reportPath = CFile::findNewFile(reportFile.str()); + std::string reportFile = getLogDirectory() + NLMISC::toString("nel_report_%u.log", (uint)time(NULL)); + reportPath = CFile::findNewFile(reportFile); std::ofstream f; f.open(reportPath.c_str()); if (!f.good()) @@ -108,36 +104,34 @@ TReportResult report(const std::string &title, const std::string &subject, const || CSystemUtils::detectWindowedApplication()) && CFile::isExists(NL_CRASH_REPORT_TOOL)) { - std::stringstream params; - params << NL_CRASH_REPORT_TOOL; + std::string params; + params += NL_CRASH_REPORT_TOOL; if (!reportPath.empty()) - params << " -log \"" << reportPath << "\""; + params += NLMISC::toString(" -log \"%s\"", reportPath.c_str()); if (!subject.empty()) - params << " -attachment \"" << attachment << "\""; + params += NLMISC::toString(" -attachment \"%s\"", attachment.c_str()); if (!title.empty()) - params << " -title \"" << title << "\""; + params += NLMISC::toString(" -title \"%s\"", title.c_str()); if (!subject.empty()) - params << " -subject \"" << subject << "\""; + params += NLMISC::toString(" -subject \"%s\"", subject.c_str()); const char *reportPostUrl = getReportPostURL(); if (reportPostUrl) - params << " -host \"" << reportPostUrl << "\""; + params += NLMISC::toString(" -host \"%s\"", reportPostUrl); if (synchronous) - params << " -dev"; + params += " -dev"; if (sendReport) - params << " -sendreport"; - - std::string paramsStr = params.str(); + params += " -sendreport"; if (synchronous) { - TReportResult result = (TReportResult)::system(paramsStr.c_str()); + TReportResult result = (TReportResult)::system(params.c_str()); if (result != ReportAlwaysIgnore && result != ReportIgnore && result != ReportAbort @@ -153,7 +147,7 @@ TReportResult report(const std::string &title, const std::string &subject, const } else { - NLMISC::launchProgram(NL_CRASH_REPORT_TOOL, paramsStr, + NLMISC::launchProgram(NL_CRASH_REPORT_TOOL, params, NL_DEBUG_REPORT ? INelContext::isContextInitialised() : false); // Only log if required, avoid infinite loop return defaultResult; } From 9b9ee4e492733a3d18567a7c2e3d0bc20400dc41 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 28 Dec 2015 18:16:07 +0100 Subject: [PATCH 4/4] Fixed: Install readme.txt in same directory if not using WITH_UNIX_STRUCTURE --HG-- branch : develop --- code/nel/tools/3d/zviewer/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/nel/tools/3d/zviewer/CMakeLists.txt b/code/nel/tools/3d/zviewer/CMakeLists.txt index a7a5150b7..35472f39c 100644 --- a/code/nel/tools/3d/zviewer/CMakeLists.txt +++ b/code/nel/tools/3d/zviewer/CMakeLists.txt @@ -14,4 +14,9 @@ NL_ADD_RUNTIME_FLAGS(zviewer) INSTALL(TARGETS zviewer RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) INSTALL(FILES zviewer.cfg DESTINATION ${NL_ETC_PREFIX} COMPONENT tools3d) -INSTALL(FILES readme.txt DESTINATION ${NL_SHARE_PREFIX}/zviewer COMPONENT tools3d) + +IF(WITH_UNIX_STRUCTURE) + INSTALL(FILES readme.txt DESTINATION ${NL_SHARE_PREFIX}/zviewer COMPONENT tools3d) +ELSE() + INSTALL(FILES readme.txt DESTINATION ${NL_SHARE_PREFIX} COMPONENT tools3d RENAME zviewer.txt) +ENDIF()