aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcrashlogger/llcrashlogger.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-01-11 16:10:10 -0600
committerJacek Antonelli2009-01-11 16:10:15 -0600
commit6156baad67c744ed03ea47798bfeb8a77698efc6 (patch)
tree872d35ff6df740462d8cb574d03f746dfd5dd1ae /linden/indra/llcrashlogger/llcrashlogger.cpp
parentSecond Life viewer sources 1.22.3-RC (diff)
downloadmeta-impy-6156baad67c744ed03ea47798bfeb8a77698efc6.zip
meta-impy-6156baad67c744ed03ea47798bfeb8a77698efc6.tar.gz
meta-impy-6156baad67c744ed03ea47798bfeb8a77698efc6.tar.bz2
meta-impy-6156baad67c744ed03ea47798bfeb8a77698efc6.tar.xz
Second Life viewer sources 1.22.4-RC
Diffstat (limited to 'linden/indra/llcrashlogger/llcrashlogger.cpp')
-rwxr-xr-xlinden/indra/llcrashlogger/llcrashlogger.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/linden/indra/llcrashlogger/llcrashlogger.cpp b/linden/indra/llcrashlogger/llcrashlogger.cpp
index 3abbb2d..9672af3 100755
--- a/linden/indra/llcrashlogger/llcrashlogger.cpp
+++ b/linden/indra/llcrashlogger/llcrashlogger.cpp
@@ -123,6 +123,33 @@ void trimSLLog(std::string& sllog)
123 } 123 }
124} 124}
125 125
126std::string getStartupStateFromLog(std::string& sllog)
127{
128 std::string startup_state = "STATE_FIRST";
129 std::string startup_token = "Startup state changing from ";
130
131 int index = sllog.rfind(startup_token);
132 if (index < 0 || index + startup_token.length() > sllog.length()) {
133 return startup_state;
134 }
135
136 // find new line
137 char cur_char = sllog[index + startup_token.length()];
138 std::string::size_type newline_loc = index + startup_token.length();
139 while(cur_char != '\n' && newline_loc < sllog.length())
140 {
141 newline_loc++;
142 cur_char = sllog[newline_loc];
143 }
144
145 // get substring and find location of " to "
146 std::string state_line = sllog.substr(index, newline_loc - index);
147 std::string::size_type state_index = state_line.find(" to ");
148 startup_state = state_line.substr(state_index + 4, state_line.length() - state_index - 4);
149
150 return startup_state;
151}
152
126void LLCrashLogger::gatherFiles() 153void LLCrashLogger::gatherFiles()
127{ 154{
128 155
@@ -232,6 +259,10 @@ void LLCrashLogger::gatherFiles()
232 std::string crash_info = s.str(); 259 std::string crash_info = s.str();
233 if(itr->first == "SecondLifeLog") 260 if(itr->first == "SecondLifeLog")
234 { 261 {
262 if(!mCrashInfo["DebugLog"].has("StartupState"))
263 {
264 mCrashInfo["DebugLog"]["StartupState"] = getStartupStateFromLog(crash_info);
265 }
235 trimSLLog(crash_info); 266 trimSLLog(crash_info);
236 } 267 }
237 268