00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef INCL_LOG
00020 #define INCL_LOG
00021
00023 #include "fscapi.h"
00024
00025 #define LOG_ERROR "ERROR"
00026 #define LOG_INFO "INFO"
00027 #define LOG_DEBUG "DEBUG"
00028
00029 #define LOG_NAME "synclog.txt"
00030
00031 typedef enum {
00032 LOG_LEVEL_NONE = 0,
00033 LOG_LEVEL_INFO = 1,
00034 LOG_LEVEL_DEBUG = 2
00035 } LogLevel;
00036
00037 extern char logmsg[];
00038
00039 class Log {
00040
00041 private:
00042
00043 void printMessage(const char* level, const char* msg, va_list argList);
00044
00045
00046
00047
00048 LogLevel logLevel;
00049
00050 public:
00051
00052 Log(BOOL reset = FALSE, const char* path = NULL, const char* name = NULL);
00053 ~Log();
00054
00055 void setLogPath(const char* configLogPath);
00056 void setLogName(const char* configLogName);
00057
00058 void error(const char* msg, ...);
00059 void info(const char* msg, ...);
00060 void debug(const char* msg, ...);
00061 void trace(const char* msg);
00062
00063 void reset(const char* title = NULL);
00064
00065 void setLevel(LogLevel level);
00066
00067 LogLevel getLevel();
00068
00069 BOOL isLoggable(LogLevel level);
00070
00071
00072
00073
00074 };
00075
00076 extern Log LOG;
00078 #endif