Check user pref for sending logs

This commit is contained in:
Latif Khalifa
2013-10-02 00:39:11 +02:00
parent 98d7721ab2
commit d20b7815df
2 changed files with 8 additions and 11 deletions

View File

@@ -189,7 +189,7 @@ bool LLCrashLogger::readMinidump(std::string minidump_path)
void LLCrashLogger::gatherFiles() void LLCrashLogger::gatherFiles()
{ {
updateApplication("Gathering logs..."); llinfos << "Gathering logs..." << llendl;
LLSD static_sd; LLSD static_sd;
LLSD dynamic_sd; LLSD dynamic_sd;
@@ -241,7 +241,7 @@ void LLCrashLogger::gatherFiles()
mCrashInfo["DebugLog"] = mDebugLog; mCrashInfo["DebugLog"] = mDebugLog;
mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log"); mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log");
updateApplication("Encoding files..."); llinfos << "Encoding files..." << llendl;
for(std::map<std::string, std::string>::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) for(std::map<std::string, std::string>::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr)
{ {
@@ -330,7 +330,7 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir)
LLSD post_data; LLSD post_data;
post_data = constructPostData(); post_data = constructPostData();
updateApplication("Sending reports..."); llinfos << "Sending reports..." << llendl;
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);
@@ -342,19 +342,17 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir)
} }
void LLCrashLogger::updateApplication(const std::string& message)
{
if (!message.empty()) llinfos << message << llendl;
}
void LLCrashLogger::checkCrashDump() void LLCrashLogger::checkCrashDump()
{ {
mCrashHost = gSavedSettings.getString("CrashHostUrl"); mCrashHost = gSavedSettings.getString("CrashHostUrl");
std::string dumpDir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "") + "singularity-debug"; std::string dumpDir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "") + "singularity-debug";
if (gDirUtilp->fileExists(dumpDir)) if (gDirUtilp->fileExists(dumpDir))
{ {
sendCrashLog(dumpDir); if (!mCrashHost.empty() && gSavedSettings.getS32("CrashSubmitBehavior") != 2)
{
sendCrashLog(dumpDir);
}
gDirUtilp->deleteDirAndContents(dumpDir); gDirUtilp->deleteDirAndContents(dumpDir);
} }
else else

View File

@@ -48,7 +48,6 @@ public:
bool saveCrashBehaviorSetting(S32 crash_behavior); bool saveCrashBehaviorSetting(S32 crash_behavior);
bool sendCrashLog(std::string dump_dir); bool sendCrashLog(std::string dump_dir);
LLSD constructPostData(); LLSD constructPostData();
virtual void updateApplication(const std::string& message = LLStringUtil::null);
void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; } void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; }
S32 getCrashBehavior() { return mCrashBehavior; } S32 getCrashBehavior() { return mCrashBehavior; }
bool readMinidump(std::string minidump_path); bool readMinidump(std::string minidump_path);