Skip to content
Snippets Groups Projects
Commit 8d4e6b6d authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

DRTVWR-447: Additional logging getting metadata for previous run

parent 787053ff
No related branches found
No related tags found
No related merge requests found
...@@ -3051,14 +3051,11 @@ void LLAppViewer::writeDebugInfo(bool isStatic) ...@@ -3051,14 +3051,11 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
? getStaticDebugFile() ? getStaticDebugFile()
: getDynamicDebugFile() ); : getDynamicDebugFile() );
LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL; LL_INFOS() << "Writing debug file " << *debug_filename << LL_ENDL;
llofstream out_file(debug_filename->c_str()); llofstream out_file(debug_filename->c_str());
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file) isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
: LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file); : LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
out_file.close();
} }
LLSD LLAppViewer::getViewerInfo() const LLSD LLAppViewer::getViewerInfo() const
......
...@@ -165,6 +165,14 @@ void cleanupViewer() ...@@ -165,6 +165,14 @@ void cleanupViewer()
class CrashMetadataSingleton: public CrashMetadata, public LLSingleton<CrashMetadataSingleton> class CrashMetadataSingleton: public CrashMetadata, public LLSingleton<CrashMetadataSingleton>
{ {
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. // Populate the fields of our public base-class struct.
...@@ -176,17 +184,26 @@ CrashMetadataSingleton::CrashMetadataSingleton() ...@@ -176,17 +184,26 @@ CrashMetadataSingleton::CrashMetadataSingleton()
staticDebugPathname = *gViewerAppPtr->getStaticDebugFile(); staticDebugPathname = *gViewerAppPtr->getStaticDebugFile();
std::ifstream static_file(staticDebugPathname); std::ifstream static_file(staticDebugPathname);
LLSD info; LLSD info;
if (static_file.is_open() && if (! static_file.is_open())
LLSDSerialize::deserialize(info, static_file, LLSDSerialize::SIZE_UNLIMITED)) {
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(); LL_INFOS() << "Metadata from '" << staticDebugPathname << "':" << LL_ENDL;
userSettingsPathname = info["SettingsFilename"].asString(); logFilePathname = get_metadata(info, "SLLog");
OSInfo = info["OSInfo"].asString(); userSettingsPathname = get_metadata(info, "SettingsFilename");
agentFullname = info["LoginName"].asString(); OSInfo = get_metadata(info, "OSInfo");
agentFullname = get_metadata(info, "LoginName");
// Translate underscores back to spaces // Translate underscores back to spaces
LLStringUtil::replaceChar(agentFullname, '_', ' '); LLStringUtil::replaceChar(agentFullname, '_', ' ');
regionName = info["CurrentRegion"].asString(); regionName = get_metadata(info, "CurrentRegion");
fatalMessage = info["FatalMessage"].asString(); fatalMessage = get_metadata(info, "FatalMessage");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment