summaryrefslogtreecommitdiff
path: root/client/Logger.h
diff options
context:
space:
mode:
authorAlex Borisov <borisov.alexandr@rambler.ru>2011-10-23 04:10:55 +0300
committerAlex Borisov <borisov.alexandr@rambler.ru>2011-10-23 04:10:55 +0300
commit21ad7eac963bc329395fa893300fb5c8f721fd77 (patch)
tree10dda6e6170071332aab490faeeb599f10ff6e03 /client/Logger.h
parent3eef0376635624c354a5e1b8a2680b74eb23a423 (diff)
Logging facility, Config class, tray icon, custom QApplication subclass
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