|
5 | 5 | #include "guiconsole.h" |
6 | 6 | #include "LogWindow.h" |
7 | 7 | #include "guiconsoleDlg.h" |
| 8 | +#include "common/common.h" |
8 | 9 | #include "../../../server/tools/message_log/messagelog_interface.h" |
9 | 10 | // CLogWindow dialog |
10 | 11 |
|
@@ -287,31 +288,39 @@ void CLogWindow::onReceiveRemoteLog(std::string str, bool fromServer) |
287 | 288 | s.Replace(L"\n\r", L""); |
288 | 289 | s.Replace(L"\r", L""); |
289 | 290 |
|
290 | | - if(s.Find(L"WARNING") >= 0 || s.Find(L"S_WARN") >= 0) |
| 291 | + std::vector<std::wstring> logSplit; |
| 292 | + KBEngine::strutil::kbe_split<wchar_t>(s.GetBuffer(0), L' ', logSplit); |
| 293 | + |
| 294 | + if(logSplit.size() == 0) |
| 295 | + return; |
| 296 | + |
| 297 | + s.Replace((logSplit[2] + L" " + logSplit[3]).c_str(), L""); |
| 298 | + |
| 299 | + if(logSplit[0] == L"WARNING" || logSplit[0] == L"S_WARN") |
291 | 300 | { |
292 | 301 | if(fromServer) |
293 | 302 | m_warnCount++; |
294 | 303 |
|
295 | 304 | if(m_warnChecked) |
296 | 305 | m_loglist.AddString(s, RGB(0, 0, 0), RGB(255, 165, 0)); |
297 | 306 | } |
298 | | - else if(s.Find(L"ERROR") >= 0 || s.Find(L"S_ERR") >= 0) |
| 307 | + else if(logSplit[0] == L"ERROR" || logSplit[0] == L"S_ERR") |
299 | 308 | { |
300 | 309 | if(fromServer) |
301 | 310 | m_errCount++; |
302 | 311 |
|
303 | 312 | if(m_errChecked) |
304 | 313 | m_loglist.AddString(s, RGB(0, 0, 0), RGB(255, 0, 0)); |
305 | 314 | } |
306 | | - else if(s.Find(L"CRITICAL") >= 0) |
| 315 | + else if(logSplit[0] == L"CRITICAL") |
307 | 316 | { |
308 | 317 | if(fromServer) |
309 | 318 | m_errCount++; |
310 | 319 |
|
311 | 320 | if(m_errChecked) |
312 | 321 | m_loglist.AddString(s, RGB(0, 0, 0), RGB(100, 149, 237)); |
313 | 322 | } |
314 | | - else if(s.Find(L"S_DBG") >= 0 || s.Find(L"S_NORM") >= 0 || s.Find(L"S_INFO") >= 0) |
| 323 | + else if(logSplit[0] == L"S_DBG" || logSplit[0] == L"S_NORM" || logSplit[0] == L"S_INFO") |
315 | 324 | { |
316 | 325 | if(fromServer) |
317 | 326 | m_infoCount++; |
@@ -371,7 +380,7 @@ void CLogWindow::pullLogs(KBEngine::Network::Address addr) |
371 | 380 | Network::Bundle bundle; |
372 | 381 | bundle.newMessage(MessagelogInterface::registerLogWatcher); |
373 | 382 |
|
374 | | - int32 uid = 0; |
| 383 | + int32 uid = dlg->getSelTreeItemUID(); |
375 | 384 | bundle << uid; |
376 | 385 |
|
377 | 386 | bundle << getSelLogTypes(); |
@@ -601,7 +610,8 @@ void CLogWindow::updateSettingToServer() |
601 | 610 | Network::Bundle bundle; |
602 | 611 | bundle.newMessage(MessagelogInterface::updateLogWatcherSetting); |
603 | 612 |
|
604 | | - int32 uid = 0; |
| 613 | + CguiconsoleDlg* dlg = static_cast<CguiconsoleDlg*>(theApp.m_pMainWnd); |
| 614 | + int32 uid = dlg->getSelTreeItemUID(); |
605 | 615 | bundle << uid; |
606 | 616 |
|
607 | 617 | bundle << getSelLogTypes(); |
@@ -644,7 +654,6 @@ void CLogWindow::updateSettingToServer() |
644 | 654 | bundle << (*iter); |
645 | 655 | } |
646 | 656 |
|
647 | | - CguiconsoleDlg* dlg = static_cast<CguiconsoleDlg*>(theApp.m_pMainWnd); |
648 | 657 | HTREEITEM item = dlg->hasCheckApp(MESSAGELOG_TYPE); |
649 | 658 | if(item == NULL) |
650 | 659 | { |
|
0 commit comments