void CLogOutput::Initialize() { if (initialized) return; filePath = CreateFilePath(fileName); RotateLogFile(); /*filelog = new std::ofstream(filePath.c_str()); if (filelog->bad()) SafeDelete(filelog);*/ const bool flush = configHandler->GetBool("LogFlush"); log_file_addLogFile(filePath.c_str(), NULL, LOG_LEVEL_ALL, flush); initialized = true; InitializeSections(); /*std::vector<std::string>::iterator pili; for (pili = preInitLog().begin(); pili != preInitLog().end(); ++pili) { ToFile(*pili); } preInitLog().clear();*/ LOG("LogOutput initialized."); LOG("Spring %s", SpringVersion::GetFull().c_str()); LOG("Build date/time: %s", SpringVersion::GetBuildTime().c_str()); LOG("Build environment: %s", SpringVersion::GetBuildEnvironment().c_str()); LOG("Compiler: %s", SpringVersion::GetCompiler().c_str()); }
void CLogOutput::Initialize() { assert(configHandler != NULL); if (IsInitialized()) return; filePath = CreateFilePath(fileName); if (configHandler->GetBool("RotateLogFiles")) RotateLogFile(); log_file_addLogFile(filePath.c_str(), NULL, LOG_LEVEL_ALL, configHandler->GetInt("LogFlushLevel")); InitializeLogSections(); LOG("LogOutput initialized."); }