void CLogAnalyzerView::OnBnClickedButtonFind() { UpdateData(TRUE); if (m_strFindContent.IsEmpty()) ShowTraces(m_strSelComponent, TRUE); else ShowTraces(m_strSelComponent, FALSE); }
Logger::Logger(std::string path) { string dir = path.substr(0, path.find_last_of("/")); m_File = new File(dir); m_File->mkdir(); // Logger is borked if this happens if (!m_File->open(path, FileAccessMode_Write)) { printf("%s\n", m_File->get_last_error().c_str()); assert(0); return; } UseColors(true); ShowTraces(true); #if DEBUG ShowDebug(true); #else ShowDebug(false); #endif // time_t raw = time(NULL); // char sTime[25]; // strftime(sTime, 25, "%m/%d/%Y @ %H:%M:%S", localtime(&raw)); Internal(string("# ") + Nepgear::FullName + " log started", "", FG_INVALID, false, false); }
void CLogAnalyzerView::ShowComponent(const CString& strComponent) { m_strSelComponent = strComponent; m_traceList.DeleteAllTraceLog(); ShowTraces(strComponent, TRUE); //Update component properties in property panel const std::map<tstring, Poco::SharedPtr<CComponent>>& components = m_logger->GetComponents(); std::map<tstring, Poco::SharedPtr<CComponent>>::const_iterator ite = components.find(m_strSelComponent.GetBuffer(m_strSelComponent.GetLength())); if (ite != components.end()) { CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd(); if (pMainFrame != NULL) { Poco::SharedPtr<SComponentProperty> compPro = new SComponentProperty; compPro->m_strComponentName = ite->second->GetComponentName(); compPro->m_nLogTraceCount = ite->second->GetTraceLogs().size(); pMainFrame->SetComponentProperty(compPro); } } }