| 218 | } |
| 219 | |
| 220 | bool ReadSysInternalsLogFileMessage(const std::string& data, Line& line, USTimeConverter& converter) |
| 221 | { |
| 222 | TabSplitter split(data); |
| 223 | auto col1 = split.GetNext(); |
| 224 | auto col2 = split.GetNext(); |
| 225 | auto col3 = split.GetTail(); |
| 226 | |
| 227 | // depending on regional settings Sysinternals debugview logs time differently. |
| 228 | // we support the four most common formats |
| 229 | // 'hh:MM:SS.mmm tt', 'hh:MM:SS tt', 'HH:MM:SS.mmm' and 'HH:MM:SS' |
| 230 | if (!converter.ReadLocalTimeUSRegionMs(col2,line.systemTime)) // try hh:MM:SS.mmm tt |
| 231 | if (!converter.ReadLocalTimeUSRegion(col2,line.systemTime)) // try hh:MM:SS tt |
| 232 | if (!ReadLocalTimeMs(col2, line.systemTime)) // try HH:MM:SS.mmm |
| 233 | if (!ReadLocalTime(col2, line.systemTime)) // try HH:MM:SS |
| 234 | ReadTime(col2, line.time); // otherwise assume relative time: S.mmmmmm |
| 235 | |
| 236 | if (!col3.empty() && col3[0] == '[') // messages from processes are preceeded by [pid], but kernel messages do not have a prefix |
| 237 | { |
| 238 | line.processName = "[unavailable]"; |
| 239 | std::istringstream is3(col3); |
| 240 | char c1, c2, c3; |
| 241 | if (is3 >> std::noskipws >> c1 >> line.pid >> c2 >> c3 && c1 == '[' && c2 == ']' && c3 == ' ' && std::getline(is3, line.message)) |
| 242 | return true; |
| 243 | } |
| 244 | else |
| 245 | { |
| 246 | line.processName = "[kernel]"; |
| 247 | } |
| 248 | line.message = split.GetTail(); |
| 249 | return true; |
| 250 | } |
| 251 | |
| 252 | bool ReadLogFileMessage(const std::string& data, Line& line) |
| 253 | { |
no test coverage detected