From 16b27c4b7ae2ccb03355148fa7fc7116190cc5fb Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 11 Mar 2014 14:16:08 -0700 Subject: Fixed a load of format string errors --- src/MCLogger.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/MCLogger.h') diff --git a/src/MCLogger.h b/src/MCLogger.h index c949a4cdf..348b51242 100644 --- a/src/MCLogger.h +++ b/src/MCLogger.h @@ -57,10 +57,10 @@ private: -extern void LOG(const char* a_Format, ...); -extern void LOGINFO(const char* a_Format, ...); -extern void LOGWARN(const char* a_Format, ...); -extern void LOGERROR(const char* a_Format, ...); +extern void LOG(const char* a_Format, ...) FORMATSTRING(1,2); +extern void LOGINFO(const char* a_Format, ...) FORMATSTRING(1,2); +extern void LOGWARN(const char* a_Format, ...) FORMATSTRING(1,2); +extern void LOGERROR(const char* a_Format, ...) FORMATSTRING(1,2); -- cgit v1.2.3 From 7e6ee7ef8158a037c11405986513aa344ce68f42 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 11 Mar 2014 14:43:14 -0700 Subject: Fixed more Format issues --- src/MCLogger.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/MCLogger.h') diff --git a/src/MCLogger.h b/src/MCLogger.h index 348b51242..ba9e4827f 100644 --- a/src/MCLogger.h +++ b/src/MCLogger.h @@ -21,10 +21,10 @@ public: // tolua_export ~cMCLogger(); // tolua_export - void Log(const char* a_Format, va_list a_ArgList); - void Info(const char* a_Format, va_list a_ArgList); - void Warn(const char* a_Format, va_list a_ArgList); - void Error(const char* a_Format, va_list a_ArgList); + void Log(const char* a_Format, va_list a_ArgList) FORMATSTRING(2,0); + void Info(const char* a_Format, va_list a_ArgList) FORMATSTRING(2,0); + void Warn(const char* a_Format, va_list a_ArgList) FORMATSTRING(2,0); + void Error(const char* a_Format, va_list a_ArgList) FORMATSTRING(2,0); void LogSimple(const char* a_Text, int a_LogType = 0 ); // tolua_export @@ -57,9 +57,9 @@ private: -extern void LOG(const char* a_Format, ...) FORMATSTRING(1,2); -extern void LOGINFO(const char* a_Format, ...) FORMATSTRING(1,2); -extern void LOGWARN(const char* a_Format, ...) FORMATSTRING(1,2); +extern void LOG(const char* a_Format, ...) FORMATSTRING(1,2); +extern void LOGINFO(const char* a_Format, ...) FORMATSTRING(1,2); +extern void LOGWARN(const char* a_Format, ...) FORMATSTRING(1,2); extern void LOGERROR(const char* a_Format, ...) FORMATSTRING(1,2); -- cgit v1.2.3 From cd6ab5617cd7b26b13cfe26a950ca17fecefd550 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 14 Mar 2014 06:11:49 -0700 Subject: Fixed xofts issues --- src/MCLogger.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/MCLogger.h') diff --git a/src/MCLogger.h b/src/MCLogger.h index ba9e4827f..996e60329 100644 --- a/src/MCLogger.h +++ b/src/MCLogger.h @@ -21,10 +21,10 @@ public: // tolua_export ~cMCLogger(); // tolua_export - void Log(const char* a_Format, va_list a_ArgList) FORMATSTRING(2,0); - void Info(const char* a_Format, va_list a_ArgList) FORMATSTRING(2,0); - void Warn(const char* a_Format, va_list a_ArgList) FORMATSTRING(2,0); - void Error(const char* a_Format, va_list a_ArgList) FORMATSTRING(2,0); + void Log(const char* a_Format, va_list a_ArgList) FORMATSTRING(2, 0); + void Info(const char* a_Format, va_list a_ArgList) FORMATSTRING(2, 0); + void Warn(const char* a_Format, va_list a_ArgList) FORMATSTRING(2, 0); + void Error(const char* a_Format, va_list a_ArgList) FORMATSTRING(2, 0); void LogSimple(const char* a_Text, int a_LogType = 0 ); // tolua_export @@ -57,10 +57,10 @@ private: -extern void LOG(const char* a_Format, ...) FORMATSTRING(1,2); -extern void LOGINFO(const char* a_Format, ...) FORMATSTRING(1,2); -extern void LOGWARN(const char* a_Format, ...) FORMATSTRING(1,2); -extern void LOGERROR(const char* a_Format, ...) FORMATSTRING(1,2); +extern void LOG(const char* a_Format, ...) FORMATSTRING(1, 2); +extern void LOGINFO(const char* a_Format, ...) FORMATSTRING(1, 2); +extern void LOGWARN(const char* a_Format, ...) FORMATSTRING(1, 2); +extern void LOGERROR(const char* a_Format, ...) FORMATSTRING(1, 2); -- cgit v1.2.3 From 7aa6a3b86663ef28295ffb914f66a8f0359a353f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 1 Apr 2014 09:32:14 +0200 Subject: LOG() API reads the LogLevel from the cCompositeChat's MessageType. --- src/MCLogger.h | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'src/MCLogger.h') diff --git a/src/MCLogger.h b/src/MCLogger.h index 996e60329..c0150c124 100644 --- a/src/MCLogger.h +++ b/src/MCLogger.h @@ -10,25 +10,36 @@ class cLog; -class cMCLogger // tolua_export -{ // tolua_export -public: // tolua_export - /// Creates a logger with the default filename, "logs/LOG_.log" +// tolua_begin +class cMCLogger +{ +public: + enum eLogLevel + { + llRegular, + llInfo, + llWarning, + llError, + }; + // tolua_end + + /** Creates a logger with the default filename, "logs/LOG_.log" */ cMCLogger(void); - /// Creates a logger with the specified filename inside "logs" folder + /** Creates a logger with the specified filename inside "logs" folder */ cMCLogger(const AString & a_FileName); // tolua_export ~cMCLogger(); // tolua_export - void Log(const char* a_Format, va_list a_ArgList) FORMATSTRING(2, 0); - void Info(const char* a_Format, va_list a_ArgList) FORMATSTRING(2, 0); - void Warn(const char* a_Format, va_list a_ArgList) FORMATSTRING(2, 0); - void Error(const char* a_Format, va_list a_ArgList) FORMATSTRING(2, 0); + void Log (const char * a_Format, va_list a_ArgList) FORMATSTRING(2, 0); + void Info (const char * a_Format, va_list a_ArgList) FORMATSTRING(2, 0); + void Warn (const char * a_Format, va_list a_ArgList) FORMATSTRING(2, 0); + void Error(const char * a_Format, va_list a_ArgList) FORMATSTRING(2, 0); - void LogSimple(const char* a_Text, int a_LogType = 0 ); // tolua_export + /** Logs the simple text message at the specified log level. */ + void LogSimple(const char * a_Text, eLogLevel a_LogLevel = llRegular); // tolua_export - static cMCLogger* GetInstance(); + static cMCLogger * GetInstance(); private: enum eColorScheme { -- cgit v1.2.3