00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef LOGGER_H
00048 #define LOGGER_H
00049 #include <iostream>
00050 #include <string>
00051 #include "DHCPConst.h"
00052
00053 #define Log(X) logger :: log##X ()
00054 #define LogEnd logger :: endl
00055
00056 namespace logger {
00057
00058 enum Elogmode {
00059 FULL,
00060 SHORT,
00061 SYSLOG,
00062 EVENTLOG
00063 };
00064
00065 using namespace std;
00066 ostream& logCont();
00067 ostream& logEmerg();
00068 ostream& logAlert();
00069 ostream& logCrit();
00070 ostream& logError();
00071 ostream& logWarning();
00072 ostream& logNotice();
00073 ostream& logInfo();
00074 ostream& logDebug();
00075
00076 void Initialize(char * file);
00077 void Terminate();
00078 void setLogName(string x);
00079 void setLogLevel(int x);
00080 void setLogMode(string x);
00081 void EchoOff();
00082 void EchoOn();
00083 string getLogName();
00084 int getLogLevel();
00085
00086 ostream & endl (ostream & strum);
00087
00088 }
00089
00090 std::string StateToString(EState state);
00091 std::string StatusCodeToString(int status);
00092
00093 #endif
00094