Skip to content
Snippets Groups Projects
Commit 6b059d18 authored by Aura Linden's avatar Aura Linden
Browse files

Crash reporter fixed, debugging removed.

parent 53ea30af
No related branches found
No related tags found
No related merge requests found
...@@ -339,10 +339,6 @@ bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg ...@@ -339,10 +339,6 @@ bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg
bool LLCrashLogger::sendCrashLogs() bool LLCrashLogger::sendCrashLogs()
{ {
std::ofstream wlog;
wlog.open("/Users/samantha/crashlogging2.txt");
wlog << "SPATTERS sendingCrashLogs.!\n";
gatherFiles(); gatherFiles();
LLSD post_data; LLSD post_data;
...@@ -354,7 +350,6 @@ bool LLCrashLogger::sendCrashLogs() ...@@ -354,7 +350,6 @@ bool LLCrashLogger::sendCrashLogs()
"SecondLifeCrashReport"); "SecondLifeCrashReport");
std::string report_file = dump_path + ".log"; std::string report_file = dump_path + ".log";
wlog << "SPATTERS looking in dump_path " << dump_path << " report_file " << report_file << "\n";
std::ofstream out_file(report_file.c_str()); std::ofstream out_file(report_file.c_str());
LLSDSerialize::toPrettyXML(post_data, out_file); LLSDSerialize::toPrettyXML(post_data, out_file);
out_file.close(); out_file.close();
...@@ -364,18 +359,14 @@ bool LLCrashLogger::sendCrashLogs() ...@@ -364,18 +359,14 @@ bool LLCrashLogger::sendCrashLogs()
//*TODO: Translate //*TODO: Translate
if(mCrashHost != "") if(mCrashHost != "")
{ {
wlog << "SPATTERS sending to MAIN host " << mCrashHost << "\n";
sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), 3, 5); sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), 3, 5);
} }
if(!sent) if(!sent)
{ {
wlog << "SPATTERS sending to MAIN host " << mAltCrashHost << "\n";
sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to alternate server"), 3, 5); sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to alternate server"), 3, 5);
} }
wlog.close();
mSentCrashLogs = sent; mSentCrashLogs = sent;
return true; return true;
...@@ -403,7 +394,6 @@ bool LLCrashLogger::init() ...@@ -403,7 +394,6 @@ bool LLCrashLogger::init()
// Rename current log file to ".old" // Rename current log file to ".old"
std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log.old"); std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log.old");
std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log"); std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log");
llinfos << "SPATTERS moving " << log_file << " to " << old_log_file <<llendl;
LLFile::rename(log_file.c_str(), old_log_file.c_str()); LLFile::rename(log_file.c_str(), old_log_file.c_str());
// Set the log file to crashreport.log // Set the log file to crashreport.log
...@@ -425,7 +415,6 @@ bool LLCrashLogger::init() ...@@ -425,7 +415,6 @@ bool LLCrashLogger::init()
return false; return false;
} }
llinfos << "SPATTERS gets to here 1" << llendl;
gServicePump = new LLPumpIO(gAPRPoolp); gServicePump = new LLPumpIO(gAPRPoolp);
gServicePump->prime(gAPRPoolp); gServicePump->prime(gAPRPoolp);
LLHTTPClient::setPump(*gServicePump); LLHTTPClient::setPump(*gServicePump);
......
...@@ -51,9 +51,6 @@ std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory, ...@@ -51,9 +51,6 @@ std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory,
YES); YES);
if ([paths count]) if ([paths count])
{ {
//NSString *bundleName = @"SecondLife";
//[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];
//path = [[paths objectAtIndex:0] stringByAppendingPathComponent:bundleName];
path = [paths objectAtIndex:0]; path = [paths objectAtIndex:0];
//SPATTERS HACK: Always attempt to create directory, ignore errors. //SPATTERS HACK: Always attempt to create directory, ignore errors.
NSError *error = nil; NSError *error = nil;
......
...@@ -66,32 +66,23 @@ void LLCrashLoggerMac::gatherPlatformSpecificFiles() ...@@ -66,32 +66,23 @@ void LLCrashLoggerMac::gatherPlatformSpecificFiles()
bool LLCrashLoggerMac::mainLoop() bool LLCrashLoggerMac::mainLoop()
{ {
std::ofstream wlog;
wlog.open("/Users/samantha/crashlogging1.txt");
wlog << "SPATTERS mainloop.!\n";
if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND) if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND)
{ {
wlog << "sending\n";
gSendReport = true; gSendReport = true;
} }
if(gRememberChoice) if(gRememberChoice)
{ {
wlog << "momento\n";
if(gSendReport) saveCrashBehaviorSetting(CRASH_BEHAVIOR_ALWAYS_SEND); if(gSendReport) saveCrashBehaviorSetting(CRASH_BEHAVIOR_ALWAYS_SEND);
else saveCrashBehaviorSetting(CRASH_BEHAVIOR_NEVER_SEND); else saveCrashBehaviorSetting(CRASH_BEHAVIOR_NEVER_SEND);
} }
if(gSendReport) if(gSendReport)
{ {
wlog << "Send report!";
setUserText(gUserNotes); setUserText(gUserNotes);
sendCrashLogs(); sendCrashLogs();
} }
wlog.close();
return true; return true;
} }
......
...@@ -29,44 +29,27 @@ ...@@ -29,44 +29,27 @@
#include "indra_constants.h" #include "indra_constants.h"
#include <iostream> #include <iostream>
#include <fstream>
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
std::ofstream wlog;
wlog.open("/Users/samantha/crashlogging.txt");
wlog << "SPATTERS starting crash reporter.!\n";
LLCrashLoggerMac app; LLCrashLoggerMac app;
wlog << "SPATTERS created app instance.!\n";
for (int x=0;x<argc;++x) wlog << "SPATTERS arg " << x << " is '" << argv[x] << "'\n";
app.parseCommandOptions(argc, argv); app.parseCommandOptions(argc, argv);
wlog << "SPATTERS parsed commands.!\n";
if (! app.init()) if (! app.init())
{ {
wlog << "SPATTERS failed to init.!\n";
llwarns << "Unable to initialize application." << llendl; llwarns << "Unable to initialize application." << llendl;
return 1; return 1;
} }
if (app.getCrashBehavior() != CRASH_BEHAVIOR_ALWAYS_SEND) if (app.getCrashBehavior() != CRASH_BEHAVIOR_ALWAYS_SEND)
{ {
wlog << "SPATTERS wanted to dialog.!\n";
// return NSApplicationMain(argc, (const char **)argv); // return NSApplicationMain(argc, (const char **)argv);
} }
wlog << "SPATTERS starting mainloop.!\n";
app.mainLoop(); app.mainLoop();
wlog << "SPATTERS finished main.!\n";
app.cleanup(); app.cleanup();
wlog << "SPATTERS finished cleanup.!\n";
llinfos << "Crash reporter finished normally." << llendl; llinfos << "Crash reporter finished normally." << llendl;
wlog.close();
return 0; return 0;
} }
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