diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-31 01:04:57 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-31 01:04:57 +0100 |
commit | d8aa0b0ec7a2ebea2fc157c623ae8cd7d0b6ba1c (patch) | |
tree | 85a995786a5f01ea108e9cd292173d282f8853d0 /src/MCLogger.cpp | |
parent | Added LOGREPLACELINE for line replacement (diff) | |
download | cuberite-d8aa0b0ec7a2ebea2fc157c623ae8cd7d0b6ba1c.tar cuberite-d8aa0b0ec7a2ebea2fc157c623ae8cd7d0b6ba1c.tar.gz cuberite-d8aa0b0ec7a2ebea2fc157c623ae8cd7d0b6ba1c.tar.bz2 cuberite-d8aa0b0ec7a2ebea2fc157c623ae8cd7d0b6ba1c.tar.lz cuberite-d8aa0b0ec7a2ebea2fc157c623ae8cd7d0b6ba1c.tar.xz cuberite-d8aa0b0ec7a2ebea2fc157c623ae8cd7d0b6ba1c.tar.zst cuberite-d8aa0b0ec7a2ebea2fc157c623ae8cd7d0b6ba1c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/MCLogger.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/MCLogger.cpp b/src/MCLogger.cpp index 632ea2efe..aebe3e1c9 100644 --- a/src/MCLogger.cpp +++ b/src/MCLogger.cpp @@ -11,6 +11,10 @@ cMCLogger * cMCLogger::s_MCLogger = NULL; bool g_ShouldColorOutput = false; +/** Flag to show whether a 'replace line' log command has been issued +Used to decide when to put a newline */ +bool g_BeginLineUpdate = false; + #ifdef _WIN32 #include <io.h> // Needed for _isatty(), not available on Linux @@ -123,14 +127,14 @@ void cMCLogger::Log(const char * a_Format, va_list a_ArgList, bool a_ShouldRepla { cCSLock Lock(m_CriticalSection); - if (!m_BeginLineUpdate && a_ShouldReplaceLine) + if (!g_BeginLineUpdate && a_ShouldReplaceLine) { a_ShouldReplaceLine = false; // Print a normal line first if this is the initial replace line - m_BeginLineUpdate = true; + g_BeginLineUpdate = true; } - else if (m_BeginLineUpdate && !a_ShouldReplaceLine) + else if (g_BeginLineUpdate && !a_ShouldReplaceLine) { - m_BeginLineUpdate = false; + g_BeginLineUpdate = false; } if (a_ShouldReplaceLine) |