diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2018-08-22 16:16:26 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2018-08-22 16:16:26 -0400 |
commit | 8d4e6b6df0d21e18a24c8e1d9f6008c2092a24c5 (patch) | |
tree | 98754db4e275315c0a99dada909fd0f659376ed8 /indra/newview | |
parent | 787053ffeb70f4e3d7ade36290ad7e75f1146b74 (diff) |
DRTVWR-447: Additional logging getting metadata for previous run
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llappviewermacosx.cpp | 33 |
2 files changed, 27 insertions, 13 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3e25b395c4..d324a82bf8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3051,14 +3051,11 @@ void LLAppViewer::writeDebugInfo(bool isStatic) ? getStaticDebugFile() : getDynamicDebugFile() ); - LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL; - llofstream out_file(debug_filename->c_str()); + LL_INFOS() << "Writing debug file " << *debug_filename << LL_ENDL; + llofstream out_file(debug_filename->c_str()); isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file) : LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file); - - - out_file.close(); } LLSD LLAppViewer::getViewerInfo() const diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 7f7284a796..77a16f7307 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -165,6 +165,14 @@ void cleanupViewer() class CrashMetadataSingleton: public CrashMetadata, public LLSingleton<CrashMetadataSingleton> { LLSINGLETON(CrashMetadataSingleton); + + // convenience method to log each metadata field retrieved by constructor + std::string get_metadata(const LLSD& info, const LLSD::String& key) const + { + std::string data(info[key].asString()); + LL_INFOS() << " " << key << "='" << data << "'" << LL_ENDL; + return data; + } }; // Populate the fields of our public base-class struct. @@ -176,17 +184,26 @@ CrashMetadataSingleton::CrashMetadataSingleton() staticDebugPathname = *gViewerAppPtr->getStaticDebugFile(); std::ifstream static_file(staticDebugPathname); LLSD info; - if (static_file.is_open() && - LLSDSerialize::deserialize(info, static_file, LLSDSerialize::SIZE_UNLIMITED)) + if (! static_file.is_open()) + { + LL_INFOS() << "Can't open '" << staticDebugPathname + << "'; no metadata about previous run" << LL_ENDL; + } + else if (! LLSDSerialize::deserialize(info, static_file, LLSDSerialize::SIZE_UNLIMITED)) + { + LL_INFOS() << "Can't parse '" << staticDebugPathname + << "'; no metadata about previous run" << LL_ENDL; + } { - logFilePathname = info["SLLog"].asString(); - userSettingsPathname = info["SettingsFilename"].asString(); - OSInfo = info["OSInfo"].asString(); - agentFullname = info["LoginName"].asString(); + LL_INFOS() << "Metadata from '" << staticDebugPathname << "':" << LL_ENDL; + logFilePathname = get_metadata(info, "SLLog"); + userSettingsPathname = get_metadata(info, "SettingsFilename"); + OSInfo = get_metadata(info, "OSInfo"); + agentFullname = get_metadata(info, "LoginName"); // Translate underscores back to spaces LLStringUtil::replaceChar(agentFullname, '_', ' '); - regionName = info["CurrentRegion"].asString(); - fatalMessage = info["FatalMessage"].asString(); + regionName = get_metadata(info, "CurrentRegion"); + fatalMessage = get_metadata(info, "FatalMessage"); } } |