diff options
Diffstat (limited to 'updater/Logger.h')
-rw-r--r--[l---------] | updater/Logger.h | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/updater/Logger.h b/updater/Logger.h index 03aacbf..cecd454 120000..100644 --- a/updater/Logger.h +++ b/updater/Logger.h @@ -1 +1,55 @@ -../client/Logger.h
\ No newline at end of file + + +#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(std::string msg, ...); + static void Debug(std::string msg, ...); + static void Info(std::string msg, ...); + static void Warn(std::string msg, ...); + static void Error(std::string msg, ...); + static void Fatal(std::string msg, ...); + static void Log(LogLevelType logLevel, std::string msg, ...); +private: + static void Log(LogLevelType logLevel, std::string msg, va_list arsg); +}; + +#else + +class Logger +{ +public: + static LogLevelType LogLevel; + + static void Trace(std::string msg, ...) {} + static void Debug(std::string msg, ...) {} + static void Info(std::string msg, ...) {} + static void Warn(std::string msg, ...) {} + static void Error(std::string msg, ...) {} + static void Fatal(std::string msg, ...) {} + static void Log(LogLevelType logLevel, std::string msg, ...) {} +}; + +#endif + +#endif
\ No newline at end of file |