bool LLCrashLogger::init() { // We assume that all the logs we're looking for reside on the current drive gDirUtilp->initAppDirs("InWorldz"); // Default to the product name "InWorldz" (this is overridden by the -name argument) mProductName = "InWorldz"; mCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes " "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)"); llinfos << "Loading crash behavior setting" << llendl; mCrashBehavior = loadCrashBehaviorSetting(); // If user doesn't want to send, bail out if (mCrashBehavior == CRASH_BEHAVIOR_NEVER_SEND) { llinfos << "Crash behavior is never_send, quitting" << llendl; return false; } gServicePump = new LLPumpIO(gAPRPoolp); gServicePump->prime(gAPRPoolp); LLHTTPClient::setPump(*gServicePump); //If we've opened the crash logger, assume we can delete the marker file if it exists if( gDirUtilp ) { std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"InWorldz.exec_marker"); LLAPRFile::remove( marker_file ); } return true; }
bool LLCrashLogger::init() { // We assume that all the logs we're looking for reside on the current drive gDirUtilp->initAppDirs("SecondLife"); // Default to the product name "Second Life" (this is overridden by the -name argument) mProductName = "Second Life"; mCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes " "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)"); llinfos << "Loading crash behavior setting" << llendl; mCrashBehavior = loadCrashBehaviorSetting(); //Run through command line options if(getOption("previous").isDefined()) { llinfos << "Previous execution did not remove SecondLife.exec_marker" << llendl; mCrashInPreviousExec = TRUE; } if(getOption("dialog").isDefined()) { llinfos << "Show the user dialog" << llendl; mCrashBehavior = CRASH_BEHAVIOR_ASK; } LLSD name = getOption("name"); if(name.isDefined()) { mProductName = name.asString(); } // If user doesn't want to send, bail out if (mCrashBehavior == CRASH_BEHAVIOR_NEVER_SEND) { llinfos << "Crash behavior is never_send, quitting" << llendl; return false; } gServicePump = new LLPumpIO(gAPRPoolp); gServicePump->prime(gAPRPoolp); LLHTTPClient::setPump(*gServicePump); //If we've opened the crash logger, assume we can delete the marker file if it exists if( gDirUtilp ) { std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); ll_apr_file_remove( marker_file ); } return true; }