summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-02 21:10:02 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-02 21:10:02 +0100
commitecbb9134a5e4c631fc10cb9251d0d18de80d6b36 (patch)
treee039c620fe6879eea77a155d25900df136478af3
parentRevert "Fixed issues with insufficient console space" (diff)
downloadcuberite-ecbb9134a5e4c631fc10cb9251d0d18de80d6b36.tar
cuberite-ecbb9134a5e4c631fc10cb9251d0d18de80d6b36.tar.gz
cuberite-ecbb9134a5e4c631fc10cb9251d0d18de80d6b36.tar.bz2
cuberite-ecbb9134a5e4c631fc10cb9251d0d18de80d6b36.tar.lz
cuberite-ecbb9134a5e4c631fc10cb9251d0d18de80d6b36.tar.xz
cuberite-ecbb9134a5e4c631fc10cb9251d0d18de80d6b36.tar.zst
cuberite-ecbb9134a5e4c631fc10cb9251d0d18de80d6b36.zip
Diffstat (limited to '')
-rw-r--r--src/Log.cpp3
-rw-r--r--src/Log.h2
-rw-r--r--src/MCLogger.cpp14
-rw-r--r--src/MCLogger.h4
4 files changed, 10 insertions, 13 deletions
diff --git a/src/Log.cpp b/src/Log.cpp
index 3938f2c24..cbb83097c 100644
--- a/src/Log.cpp
+++ b/src/Log.cpp
@@ -18,8 +18,7 @@
cLog* cLog::s_Log = NULL;
cLog::cLog(const AString & a_FileName )
- : m_File(NULL),
- m_LastStringSize(0)
+ : m_File(NULL)
{
s_Log = this;
diff --git a/src/Log.h b/src/Log.h
index 8a0ee9fc7..c8c26913b 100644
--- a/src/Log.h
+++ b/src/Log.h
@@ -10,7 +10,7 @@ class cLog
private:
FILE * m_File;
static cLog * s_Log;
- size_t m_LastStringSize;
+ size_t m_LastStringSize = 0;
public:
cLog(const AString & a_FileName);
~cLog();
diff --git a/src/MCLogger.cpp b/src/MCLogger.cpp
index b7b826374..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
@@ -34,7 +38,6 @@ cMCLogger * cMCLogger::GetInstance(void)
cMCLogger::cMCLogger(void)
- : m_BeginLineUpdate(false)
{
AString FileName;
Printf(FileName, "LOG_%d.txt", (int)time(NULL));
@@ -46,7 +49,6 @@ cMCLogger::cMCLogger(void)
cMCLogger::cMCLogger(const AString & a_FileName)
- : m_BeginLineUpdate(false)
{
InitLog(a_FileName);
}
@@ -125,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)
diff --git a/src/MCLogger.h b/src/MCLogger.h
index 4550cc55d..c105ab6e2 100644
--- a/src/MCLogger.h
+++ b/src/MCLogger.h
@@ -51,10 +51,6 @@ private:
/// Common initialization for all constructors, creates a logfile with the specified name and assigns s_MCLogger to this
void InitLog(const AString & a_FileName);
-
- /** Flag to show whether a 'replace line' log command has been issued
- Used to decide when to put a newline */
- bool m_BeginLineUpdate;
}; // tolua_export