Skip to content

Commit e78f998

Browse files
committed
#4939 Bugsplat often confuses log files on mac, try to make it more reliable
1 parent 4ea810c commit e78f998

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

indra/newview/llappdelegate-objc.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,12 @@ - (NSString *)applicationKeyForBugSplat:(BugSplat *)bugSplat signal:(NSString *)
350350
info.push_back(AttachmentInfo(secondLogPath, "text/xml"));
351351
}
352352

353-
// We "happen to know" that info[0].basename is "SecondLife.old" -- due to
353+
// We "happen to know" that info[0].basename is "SecondLife.crash" -- due to
354354
// the fact that BugsplatMac only notices a crash during the viewer run
355355
// following the crash.
356356
// The Bugsplat service doesn't respect the MIME type above when returning
357357
// the log data to a browser, so take this opportunity to rename the file
358-
// from <base>.old to <base>_log.txt
358+
// from <base>.crash to <base>_log.txt
359359
info[0].basename =
360360
boost::filesystem::path(info[0].pathname).stem().string() + "_log.txt";
361361
infos("attachmentsForBugsplatStartupManager attaching log " + info[0].basename);

indra/newview/llappviewer.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3622,7 +3622,10 @@ void LLAppViewer::writeSystemInfo()
36223622
if (! gDebugInfo.has("Dynamic") )
36233623
gDebugInfo["Dynamic"] = LLSD::emptyMap();
36243624

3625-
#if LL_WINDOWS && !LL_BUGSPLAT
3625+
#if LL_DARWIN
3626+
// crash processing in CrashMetadataSingleton reads SLLog
3627+
gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.crash");
3628+
#elif LL_WINDOWS && !LL_BUGSPLAT
36263629
gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"SecondLife.log");
36273630
#else
36283631
// Far from ideal, especially when multiple instances get involved.
@@ -4034,6 +4037,22 @@ void LLAppViewer::processMarkerFiles()
40344037
}
40354038
LLAPRFile::remove(error_marker_file);
40364039
}
4040+
4041+
#if LL_DARWIN
4042+
if (!mSecondInstance && gLastExecEvent != LAST_EXEC_NORMAL)
4043+
{
4044+
// While windows reports crashes immediately, mac reports next run and
4045+
// may take a while to trigger crash report so it has a special file.
4046+
// Remove .crash file if exists
4047+
std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,
4048+
"SecondLife.old");
4049+
std::string crash_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,
4050+
"SecondLife.crash");
4051+
LLFile::remove(crash_log_file);
4052+
// Rename ".old" log file to ".crash"
4053+
LLFile::rename(old_log_file, crash_log_file);
4054+
}
4055+
#endif
40374056
}
40384057

40394058
void LLAppViewer::removeMarkerFiles()

0 commit comments

Comments
 (0)