summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-18 18:51:34 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-18 18:51:34 +0100
commit57dedd585c248361a8f5ef902d13bc2354447500 (patch)
tree398d8e0df78fcf50178edeab01c4c49cec4e48a9 /source
parentLogging: added LOGD macro that logs only in debug builds (diff)
downloadcuberite-57dedd585c248361a8f5ef902d13bc2354447500.tar
cuberite-57dedd585c248361a8f5ef902d13bc2354447500.tar.gz
cuberite-57dedd585c248361a8f5ef902d13bc2354447500.tar.bz2
cuberite-57dedd585c248361a8f5ef902d13bc2354447500.tar.lz
cuberite-57dedd585c248361a8f5ef902d13bc2354447500.tar.xz
cuberite-57dedd585c248361a8f5ef902d13bc2354447500.tar.zst
cuberite-57dedd585c248361a8f5ef902d13bc2354447500.zip
Diffstat (limited to '')
-rw-r--r--source/cLog.cpp7
-rw-r--r--source/cLog.h6
-rw-r--r--source/cMCLogger.cpp5
3 files changed, 11 insertions, 7 deletions
diff --git a/source/cLog.cpp b/source/cLog.cpp
index f44dedf1f..f8d1c731b 100644
--- a/source/cLog.cpp
+++ b/source/cLog.cpp
@@ -5,9 +5,10 @@
#include <fstream>
#include <ctime>
-#include <stdarg.h>
#include "cMakeDir.h"
+#include "cIsThread.h"
+
@@ -120,7 +121,11 @@ void cLog::Log(const char * a_Format, va_list argList)
#endif
AString Line;
+ #ifdef _DEBUG
+ Printf(Line, "[%04x|%02d:%02d:%02d] %s\n", cIsThread::GetCurrentID(), timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, Message.c_str());
+ #else
Printf(Line, "[%02d:%02d:%02d] %s\n", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, Message.c_str());
+ #endif
if (m_File)
{
fputs(Line.c_str(), m_File);
diff --git a/source/cLog.h b/source/cLog.h
index b218580ce..1a688b0c0 100644
--- a/source/cLog.h
+++ b/source/cLog.h
@@ -1,12 +1,8 @@
+
#pragma once
-#include "MemoryLeak.h"
#include "FileDefine.h"
-#ifndef _WIN32
- #include <stdarg.h>
-#endif
-
diff --git a/source/cMCLogger.cpp b/source/cMCLogger.cpp
index c1571a195..e966e7788 100644
--- a/source/cMCLogger.cpp
+++ b/source/cMCLogger.cpp
@@ -1,7 +1,6 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
-#include <cstdarg>
#include <time.h>
#include "cLog.h"
@@ -186,3 +185,7 @@ void LOGERROR(const char* a_Format, ...)
cMCLogger::GetInstance()->Error( a_Format, argList );
va_end(argList);
}
+
+
+
+