Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Logger.h

Go to the documentation of this file.
00001 /*
00002  * Dibbler - a portable DHCPv6
00003  *
00004  * authors: Tomasz Mrugalski <thomson@klub.com.pl>
00005  *          Marek Senderski <msend@o2.pl>
00006  *
00007  * $Id: Logger.h,v 1.11 2005/02/01 00:57:36 thomson Exp $
00008  *
00009  * $Log: Logger.h,v $
00010  * Revision 1.11  2005/02/01 00:57:36  thomson
00011  * no message
00012  *
00013  * Revision 1.10  2004/12/08 00:17:59  thomson
00014  * StatusCodeToString function added.
00015  *
00016  * Revision 1.9  2004/12/02 00:51:06  thomson
00017  * Log files are now always created (bugs #34, #36)
00018  *
00019  * Revision 1.8  2004/10/27 22:07:56  thomson
00020  * Signed/unsigned issues fixed, Lifetime option implemented, INFORMATION-REQUEST
00021  * message is now sent properly. Valid lifetime granted by server fixed.
00022  *
00023  * Revision 1.7  2004/09/03 20:58:36  thomson
00024  * *** empty log message ***
00025  *
00026  * Revision 1.6  2004/06/04 21:02:45  thomson
00027  * *** empty log message ***
00028  *
00029  * Revision 1.5  2004/06/04 16:55:27  thomson
00030  * *** empty log message ***
00031  *
00032  * Revision 1.4  2004/05/23 19:12:34  thomson
00033  * *** empty log message ***
00034  *
00035  * Revision 1.3  2004/04/10 12:18:01  thomson
00036  * Numerous fixes: LogName, LogMode options added, dns-servers changed to
00037  * dns-server, '' around strings are no longer needed.
00038  *
00039  * Revision 1.2  2004/03/29 22:06:49  thomson
00040  * 0.1.1 version
00041  *
00042  *
00043  * Released under GNU GPL v2 licence
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 

Generated on Wed Mar 16 00:10:26 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1