From 74711a2cf263a131799bd29f566c6929377617d3 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 26 May 2021 14:57:31 +0300 Subject: SL-15196 Attach correct log file to Bugsplat report --- indra/newview/llappviewermacosx.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'indra/newview/llappviewermacosx.cpp') diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 662164af2d..75ce26fb18 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -57,6 +57,7 @@ #include #include "lldir.h" +#include "lldiriterator.h" #include #include // for systemwide mute class LLMediaCtrl; // for LLURLDispatcher @@ -154,6 +155,14 @@ void cleanupViewer() gViewerAppPtr = NULL; } +void clearDumpLogsDir() +{ + if (!LLAppViewer::instance()->isSecondInstance()) + { + gDirUtilp->deleteDirAndContents(gDirUtilp->getDumpLogsDirPath()); + } +} + // The BugsplatMac API is structured as a number of different method // overrides, each returning a different piece of metadata. But since we // obtain such metadata by opening and parsing a file, it seems ridiculous to @@ -199,6 +208,7 @@ CrashMetadataSingleton::CrashMetadataSingleton() else { LL_INFOS() << "Metadata from '" << staticDebugPathname << "':" << LL_ENDL; + logFilePathname = get_metadata(info, "SLLog"); userSettingsPathname = get_metadata(info, "SettingsFilename"); accountSettingsPathname = get_metadata(info, "PerAccountSettingsFilename"); @@ -208,6 +218,24 @@ CrashMetadataSingleton::CrashMetadataSingleton() LLStringUtil::replaceChar(agentFullname, '_', ' '); regionName = get_metadata(info, "CurrentRegion"); fatalMessage = get_metadata(info, "FatalMessage"); + + if (gDirUtilp->fileExists(gDirUtilp->getDumpLogsDirPath())) + { + LLDirIterator file_iter(gDirUtilp->getDumpLogsDirPath(), "*.log"); + std::string file_name; + bool found = true; + while(found) + { + if((found = file_iter.next(file_name))) + { + std::string log_filename = gDirUtilp->getDumpLogsDirPath(file_name); + if(LLError::logFileName() != log_filename) + { + secondLogFilePathname = log_filename; + } + } + } + } } } -- cgit v1.2.3