1
0

Fixed log files' timestamps

Also made Release mode log less technical information about the world
storage threads.
This commit is contained in:
Tiger Wang 2015-06-14 11:23:14 +01:00
parent d961693020
commit 882f7c70c0
3 changed files with 12 additions and 12 deletions

View File

@ -299,15 +299,15 @@ cLogger::cListener * MakeConsoleListener(bool a_IsService)
cFileListener::cFileListener(void) cFileListener::cFileListener(void)
{ {
cFile::CreateFolder(FILE_IO_PREFIX + AString("logs")); cFile::CreateFolder(FILE_IO_PREFIX + AString("logs"));
AString FileName; m_File.Open(
auto time = std::chrono::system_clock::now(); FILE_IO_PREFIX + Printf(
FileName = Printf( "logs/LOG_%lld.txt",
"%s%sLOG_%d.txt", std::chrono::duration_cast<std::chrono::seconds>(
FILE_IO_PREFIX, std::chrono::system_clock::now().time_since_epoch()
"logs/", ).count()
std::chrono::duration_cast<std::chrono::duration<int, std::milli>>(time.time_since_epoch()).count() ),
cFile::fmAppend
); );
m_File.Open(FileName, cFile::fmAppend);
} }
@ -326,7 +326,7 @@ void cFileListener::Log(AString a_Message, cLogger::eLogLevel a_LogLevel)
} }
case cLogger::llInfo: case cLogger::llInfo:
{ {
LogLevelPrefix = "info "; LogLevelPrefix = "Info ";
break; break;
} }
case cLogger::llWarning: case cLogger::llWarning:

View File

@ -261,7 +261,7 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> overridesRepo)
delete m_FurnaceRecipe; m_FurnaceRecipe = nullptr; delete m_FurnaceRecipe; m_FurnaceRecipe = nullptr;
delete m_CraftingRecipes; m_CraftingRecipes = nullptr; delete m_CraftingRecipes; m_CraftingRecipes = nullptr;
LOGD("Unloading worlds..."); LOG("Unloading worlds...");
UnloadWorlds(); UnloadWorlds();
LOGD("Stopping plugin manager..."); LOGD("Stopping plugin manager...");

View File

@ -84,7 +84,7 @@ void cWorldStorage::Stop(void)
void cWorldStorage::WaitForFinish(void) void cWorldStorage::WaitForFinish(void)
{ {
LOG("Waiting for the world storage to finish saving"); LOGD("Waiting for the world storage to finish saving");
{ {
m_LoadQueue.Clear(); m_LoadQueue.Clear();
@ -97,7 +97,7 @@ void cWorldStorage::WaitForFinish(void)
m_ShouldTerminate = true; m_ShouldTerminate = true;
m_Event.Set(); // Wake up the thread if waiting m_Event.Set(); // Wake up the thread if waiting
super::Wait(); super::Wait();
LOG("World storage thread finished"); LOGD("World storage thread finished");
} }