From 0a7fd3686a09a53ebe86e1e37b156e2f04f6cb2f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 27 Feb 2017 09:52:50 -0500 Subject: Look for logcontrol-dev.xml in the user settings directory --- indra/llcommon/llerror.cpp | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'indra/llcommon/llerror.cpp') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index e6407ecf22..2fe9775e10 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -312,7 +312,7 @@ namespace LOG_CLASS(LogControlFile); public: - static LogControlFile& fromDirectory(const std::string& dir); + static LogControlFile& fromDirectory(const std::string& user_dir, const std::string& app_dir); virtual bool loadFile(); @@ -322,13 +322,12 @@ namespace { } }; - LogControlFile& LogControlFile::fromDirectory(const std::string& dir) + LogControlFile& LogControlFile::fromDirectory(const std::string& user_dir, const std::string& app_dir) { - std::string dirBase = dir + "/"; - // NB: We have no abstraction in llcommon for the "proper" - // delimiter but it turns out that "/" works on all three platforms + // NB: We have no abstraction in llcommon for the "proper" + // delimiter but it turns out that "/" works on all three platforms - std::string file = dirBase + "logcontrol-dev.xml"; + std::string file = user_dir + "/logcontrol-dev.xml"; llstat stat_info; if (LLFile::stat(file, &stat_info)) { @@ -336,7 +335,7 @@ namespace // if it doesn't exist. LLFile has no better abstraction for // testing for file existence. - file = dirBase + "logcontrol.xml"; + file = app_dir + "/logcontrol.xml"; } return * new LogControlFile(file); // NB: This instance is never freed @@ -363,7 +362,7 @@ namespace } LLError::configure(configuration); - LL_INFOS() << "logging reconfigured from " << filename() << LL_ENDL; + LL_INFOS("LogControlFile") << "logging reconfigured from " << filename() << LL_ENDL; return true; } @@ -615,7 +614,7 @@ namespace } - void commonInit(const std::string& dir, bool log_to_stderr = true) + void commonInit(const std::string& user_dir, const std::string& app_dir, bool log_to_stderr = true) { LLError::Settings::getInstance()->reset(); @@ -635,7 +634,7 @@ namespace LLError::addRecorder(recordToWinDebug); #endif - LogControlFile& e = LogControlFile::fromDirectory(dir); + LogControlFile& e = LogControlFile::fromDirectory(user_dir, app_dir); // NOTE: We want to explicitly load the file before we add it to the event timer // that checks for changes to the file. Else, we're not actually loading the file yet, @@ -651,23 +650,9 @@ namespace namespace LLError { - void initForServer(const std::string& identity) + void initForApplication(const std::string& user_dir, const std::string& app_dir, bool log_to_stderr) { - std::string dir = "/opt/linden/etc"; - if (LLApp::instance()) - { - dir = LLApp::instance()->getOption("configdir").asString(); - } - commonInit(dir); -#if !LL_WINDOWS - LLError::RecorderPtr recordToSyslog(new RecordToSyslog(identity)); - addRecorder(recordToSyslog); -#endif - } - - void initForApplication(const std::string& dir, bool log_to_stderr) - { - commonInit(dir, log_to_stderr); + commonInit(user_dir, app_dir, log_to_stderr); } void setPrintLocation(bool print) -- cgit v1.2.3 From e479d51068e1b9d8c840b263f41d6fe79aee717c Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 9 Mar 2017 14:16:33 -0500 Subject: experiment reformatting of tags in log lines --- indra/llcommon/llerror.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/llerror.cpp') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 2fe9775e10..02d920b581 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -571,8 +571,9 @@ namespace LLError mFunctionString += std::string(mFunction) + ":"; for (size_t i = 0; i < mTagCount; i++) { - mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : ","); + mTagString += mTags[i] + ((i == mTagCount - 1) ? "" : ","); } + mTagString += std::string("#"); } CallSite::~CallSite() -- cgit v1.2.3 From dd63291355a09411a2242d7ef84d49eece8cb6e1 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 9 Mar 2017 17:56:30 -0500 Subject: construct tag string without using += --- indra/llcommon/llerror.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llerror.cpp') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 02d920b581..b66c3c3c20 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -571,9 +571,10 @@ namespace LLError mFunctionString += std::string(mFunction) + ":"; for (size_t i = 0; i < mTagCount; i++) { - mTagString += mTags[i] + ((i == mTagCount - 1) ? "" : ","); + mTagString.append(mTags[i]); + mTagString.append((i == mTagCount - 1) ? "" : ","); } - mTagString += std::string("#"); + mTagString.append("#"); } CallSite::~CallSite() -- cgit v1.2.3 From 347015be33559ca035e1b119d361423b906555db Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 20 Jun 2017 17:03:20 -0400 Subject: fix presentation of log tags for better searchability --- indra/llcommon/llerror.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/llerror.cpp') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index b66c3c3c20..a1ad9e84b5 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -569,12 +569,13 @@ namespace LLError } #endif mFunctionString += std::string(mFunction) + ":"; + const std::string tag_hash("#"); for (size_t i = 0; i < mTagCount; i++) { + mTagString.append(tag_hash); mTagString.append(mTags[i]); mTagString.append((i == mTagCount - 1) ? "" : ","); } - mTagString.append("#"); } CallSite::~CallSite() -- cgit v1.2.3 From fa53653e60f5761c157b76423b4449fe38788d8f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 24 Jul 2017 14:49:56 -0400 Subject: fix separator between tags and file/function --- indra/llcommon/llerror.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llerror.cpp') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index a1ad9e84b5..e14fd95639 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -574,7 +574,7 @@ namespace LLError { mTagString.append(tag_hash); mTagString.append(mTags[i]); - mTagString.append((i == mTagCount - 1) ? "" : ","); + mTagString.append((i == mTagCount - 1) ? ";" : ","); } } -- cgit v1.2.3