summaryrefslogtreecommitdiffstats
path: root/src/MCLogger.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-02 21:10:31 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-02 21:10:31 +0100
commitd9a9052de733d88e49a2df9f455632c64f2c5b5d (patch)
tree1bf9c5a67322e34a5ff32f4586010d453a1f1c4c /src/MCLogger.cpp
parentRevert "Improved code" (diff)
downloadcuberite-d9a9052de733d88e49a2df9f455632c64f2c5b5d.tar
cuberite-d9a9052de733d88e49a2df9f455632c64f2c5b5d.tar.gz
cuberite-d9a9052de733d88e49a2df9f455632c64f2c5b5d.tar.bz2
cuberite-d9a9052de733d88e49a2df9f455632c64f2c5b5d.tar.lz
cuberite-d9a9052de733d88e49a2df9f455632c64f2c5b5d.tar.xz
cuberite-d9a9052de733d88e49a2df9f455632c64f2c5b5d.tar.zst
cuberite-d9a9052de733d88e49a2df9f455632c64f2c5b5d.zip
Diffstat (limited to '')
-rw-r--r--src/MCLogger.cpp58
1 files changed, 6 insertions, 52 deletions
diff --git a/src/MCLogger.cpp b/src/MCLogger.cpp
index 632ea2efe..4f3e5dc0f 100644
--- a/src/MCLogger.cpp
+++ b/src/MCLogger.cpp
@@ -119,51 +119,13 @@ void cMCLogger::LogSimple(const char* a_Text, int a_LogType /* = 0 */ )
-void cMCLogger::Log(const char * a_Format, va_list a_ArgList, bool a_ShouldReplaceLine)
+void cMCLogger::Log(const char * a_Format, va_list a_ArgList)
{
cCSLock Lock(m_CriticalSection);
-
- if (!m_BeginLineUpdate && a_ShouldReplaceLine)
- {
- a_ShouldReplaceLine = false; // Print a normal line first if this is the initial replace line
- m_BeginLineUpdate = true;
- }
- else if (m_BeginLineUpdate && !a_ShouldReplaceLine)
- {
- m_BeginLineUpdate = false;
- }
-
- if (a_ShouldReplaceLine)
- {
-#ifdef _WIN32
- HANDLE Output = GetStdHandle(STD_OUTPUT_HANDLE);
-
- CONSOLE_SCREEN_BUFFER_INFO csbi;
- GetConsoleScreenBufferInfo(Output, &csbi);
-
- COORD Position = { 0, csbi.dwCursorPosition.Y - 1 }; // Move cursor up one line
- SetConsoleCursorPosition(Output, Position);
-
- SetColor(csRegular);
- m_Log->Log(a_Format, a_ArgList, a_ShouldReplaceLine);
- ResetColor();
-
- Position = { 0, csbi.dwCursorPosition.Y }; // Set cursor to original position
- SetConsoleCursorPosition(Output, Position);
-#else // _WIN32
- fputs("\033[1A", stdout); // Move cursor up one line
- SetColor(csRegular);
- m_Log->Log(a_Format, a_ArgList, a_ShouldReplaceLine);
- ResetColor();
-#endif
- }
- else
- {
- SetColor(csRegular);
- m_Log->Log(a_Format, a_ArgList, a_ShouldReplaceLine);
- ResetColor();
- puts("");
- }
+ SetColor(csRegular);
+ m_Log->Log(a_Format, a_ArgList);
+ ResetColor();
+ puts("");
}
@@ -226,7 +188,7 @@ void cMCLogger::SetColor(eColorScheme a_Scheme)
default: ASSERT(!"Unhandled color scheme");
}
SetConsoleTextAttribute(g_Console, Attrib);
- #elif (defined(__linux) || defined(__apple)) && !defined(ANDROID_NDK)
+ #elif defined(__linux) && !defined(ANDROID_NDK)
switch (a_Scheme)
{
case csRegular: printf("\x1b[0m"); break; // Whatever the console default is
@@ -262,14 +224,6 @@ void cMCLogger::ResetColor(void)
//////////////////////////////////////////////////////////////////////////
// Global functions
-void LOGREPLACELINE(const char* a_Format, ...)
-{
- va_list argList;
- va_start(argList, a_Format);
- cMCLogger::GetInstance()->Log(a_Format, argList, true);
- va_end(argList);
-}
-
void LOG(const char* a_Format, ...)
{
va_list argList;