summaryrefslogtreecommitdiff
path: root/client/Logger.h
diff options
context:
space:
mode:
Diffstat (limited to 'client/Logger.h')
-rw-r--r--client/Logger.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/client/Logger.h b/client/Logger.h
new file mode 100644
index 0000000..c5cf70f
--- /dev/null
+++ b/client/Logger.h
@@ -0,0 +1,55 @@
+
+
+#ifndef LOG_H
+#define LOG_H
+
+enum LogLevelType
+{
+ TraceLevel = 0,
+ DebugLevel,
+ InfoLevel,
+ WarnLevel,
+ ErrorLevel,
+ FatalLevel
+};
+
+
+#ifdef DEBUG
+
+#include <stdarg.h>
+
+class Logger
+{
+public:
+ static LogLevelType LogLevel;
+
+ static void Trace(char* msgfmt, ...);
+ static void Debug(char* msgfmt, ...);
+ static void Info(char* msgfmt, ...);
+ static void Warn(char* msgfmt, ...);
+ static void Error(char* msgfmt, ...);
+ static void Fatal(char* msgfmt, ...);
+ static void Log(LogLevelType logLevel, char* msgfmt, ...);
+private:
+ static void Log(LogLevelType logLevel, char* msgfmt, va_list arsg);
+};
+
+#else
+
+class Logger
+{
+public:
+ static LogLevelType LogLevel;
+
+ static void Trace(char* msgfmt, ...) {}
+ static void Debug(char* msgfmt, ...) {}
+ static void Info(char* msgfmt, ...) {}
+ static void Warn(char* msgfmt, ...) {}
+ static void Error(char* msgfmt, ...) {}
+ static void Fatal(char* msgfmt, ...) {}
+ static void Log(LogLevelType logLevel, char* msgfmt, ...) {}
+};
+
+#endif
+
+#endif \ No newline at end of file