summaryrefslogtreecommitdiff
path: root/indra/llcrashlogger
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcrashlogger')
-rwxr-xr-xindra/llcrashlogger/llcrashlogger.cpp25
-rwxr-xr-xindra/llcrashlogger/llcrashlogger.h18
2 files changed, 21 insertions, 22 deletions
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index 2640390b9c..32dea6c707 100755
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -76,7 +76,7 @@ bool LLCrashLoggerText::mainLoop()
return true;
}
-void LLCrashLoggerText::updateApplication(LLString message)
+void LLCrashLoggerText::updateApplication(const std::string& message)
{
LLCrashLogger::updateApplication(message);
std::cout << message << std::endl;
@@ -120,10 +120,8 @@ void LLCrashLogger::gatherFiles()
updateApplication("Gathering logs...");
// Figure out the filename of the debug log
- std::string db_file_name = gDirUtilp->getExpandedFilename(
- LL_PATH_LOGS,
- "debug_info.log");
- llifstream debug_log_file(db_file_name.c_str());
+ std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log");
+ std::ifstream debug_log_file(db_file_name.c_str());
// Look for it in the debug_info.log file
if (debug_log_file.is_open())
@@ -161,12 +159,12 @@ void LLCrashLogger::gatherFiles()
updateApplication("Encoding files...");
- for(std::map<LLString, LLString>::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr)
+ for(std::map<std::string, std::string>::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr)
{
std::ifstream f((*itr).second.c_str());
if(!f.is_open())
{
- std::cout << "Can't find file " << (*itr).second.c_str() << std::endl;
+ std::cout << "Can't find file " << (*itr).second << std::endl;
continue;
}
std::stringstream s;
@@ -212,10 +210,10 @@ bool LLCrashLogger::saveCrashBehaviorSetting(S32 crash_behavior)
return true;
}
-bool LLCrashLogger::runCrashLogPost(LLString host, LLSD data, LLString msg, int retries, int timeout)
+bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout)
{
gBreak = false;
- LLString status_message;
+ std::string status_message;
for(int i = 0; i < retries; ++i)
{
status_message = llformat("%s, try %d...", msg.c_str(), i+1);
@@ -251,14 +249,15 @@ bool LLCrashLogger::sendCrashLogs()
bool sent = false;
+ //*TODO: Translate
if(mCrashHost != "")
{
- sent = runCrashLogPost(mCrashHost, post_data, "Sending to server", 3, 5);
+ sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), 3, 5);
}
if(!sent)
{
- sent = runCrashLogPost(mAltCrashHost, post_data, "Sending to alternate server", 3, 5);
+ sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to alternate server"), 3, 5);
}
mSentCrashLogs = sent;
@@ -266,7 +265,7 @@ bool LLCrashLogger::sendCrashLogs()
return true;
}
-void LLCrashLogger::updateApplication(LLString message)
+void LLCrashLogger::updateApplication(const std::string& message)
{
gServicePump->pump();
gServicePump->callback();
@@ -319,7 +318,7 @@ bool LLCrashLogger::init()
//If we've opened the crash logger, assume we can delete the marker file if it exists
if( gDirUtilp )
{
- LLString marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker");
+ std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker");
ll_apr_file_remove( marker_file );
}
diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h
index c4a583371e..b8856c8872 100755
--- a/indra/llcrashlogger/llcrashlogger.h
+++ b/indra/llcrashlogger/llcrashlogger.h
@@ -50,23 +50,23 @@ public:
bool saveCrashBehaviorSetting(S32 crash_behavior);
bool sendCrashLogs();
LLSD constructPostData();
- virtual void updateApplication(LLString message = "");
+ virtual void updateApplication(const std::string& message = LLStringUtil::null);
virtual bool init();
virtual bool mainLoop() = 0;
virtual bool cleanup() { return true; }
- void setUserText(LLString& text) { mCrashInfo["UserNotes"] = text; }
+ void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; }
S32 getCrashBehavior() { return mCrashBehavior; }
- bool runCrashLogPost(LLString host, LLSD data, LLString msg, int retries, int timeout);
+ bool runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout);
protected:
S32 mCrashBehavior;
BOOL mCrashInPreviousExec;
- std::map<LLString, LLString> mFileMap;
- LLString mGridName;
+ std::map<std::string, std::string> mFileMap;
+ std::string mGridName;
LLControlGroup mCrashSettings;
- LLString mProductName;
+ std::string mProductName;
LLSD mCrashInfo;
- LLString mCrashHost;
- LLString mAltCrashHost;
+ std::string mCrashHost;
+ std::string mAltCrashHost;
LLSD mDebugLog;
bool mSentCrashLogs;
};
@@ -78,7 +78,7 @@ public:
~LLCrashLoggerText(void) {}
virtual bool mainLoop();
- virtual void updateApplication(LLString message = "");
+ virtual void updateApplication(const std::string& message = LLStringUtil::null);
};