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

SL-821: Send the SecondLife.log from the previous (crashed) run.

Also clean up log messages.
parent 3376b2ac
No related branches found
No related tags found
No related merge requests found
......@@ -196,21 +196,27 @@
#if defined(LL_BUGSPLAT)
#if 0
// Apparently this override method only contributes the User Description field
// of BugSplat's All Crashes table. Despite the method name, it would seem to
// be a bad place to try to stuff all of SecondLife.log.
- (NSString *)applicationLogForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager
{
// return NSStringFromSelector(_cmd);
infos("Reached applicationLogForBugsplatStartupManager");
return @"[contents of SecondLife.log]";
}
#endif
- (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager {
std::string logfile = getLogFilePathname();
infos("Reached attachmentForBugsplatStartupManager with:");
infos(logfile);
// We get the *old* log file pathname (for SecondLife.old) because it's on
// the run *following* the crash that BugsplatStartupManager notices that
// the previous run crashed and calls this override. By that time, we've
// already renamed SecondLife.log to SecondLife.old.
std::string logfile = getOldLogFilePathname();
NSString *ns_logfile = [NSString stringWithCString:logfile.c_str()
encoding:NSUTF8StringEncoding];
NSData *data = [NSData dataWithContentsOfFile:ns_logfile];
infos("Read logfile");
// Apologies for the hard-coded log-file basename, but I do not know the
// incantation for "$(basename "$logfile")" in this language.
......@@ -218,7 +224,7 @@
[[BugsplatAttachment alloc] initWithFilename:@"SecondLife.log"
attachmentData:data
contentType:@"text/plain"];
infos("returning attachment");
infos("attachmentForBugsplatStartupManager: attaching " + logfile);
return attachment;
}
......
......@@ -29,7 +29,7 @@ void handleUrl(const char* url_utf8);
bool pumpMainLoop();
void handleQuit();
void cleanupViewer();
std::string getLogFilePathname();
std::string getOldLogFilePathname();
void infos(const std::string& message);
#endif /* ! defined(LL_LLAPPVIEWERMACOSX_FOR_OBJC_H) */
......@@ -148,9 +148,9 @@ void cleanupViewer()
gViewerAppPtr = NULL;
}
std::string getLogFilePathname()
std::string getOldLogFilePathname()
{
return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log");
return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.old");
}
void infos(const std::string& message)
......
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