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.10 2004/12/08 00:17:59 thomson Exp $
00008  *
00009  * $Log: Logger.h,v $
00010  * Revision 1.10  2004/12/08 00:17:59  thomson
00011  * StatusCodeToString function added.
00012  *
00013  * Revision 1.9  2004/12/02 00:51:06  thomson
00014  * Log files are now always created (bugs #34, #36)
00015  *
00016  * Revision 1.8  2004/10/27 22:07:56  thomson
00017  * Signed/unsigned issues fixed, Lifetime option implemented, INFORMATION-REQUEST
00018  * message is now sent properly. Valid lifetime granted by server fixed.
00019  *
00020  * Revision 1.7  2004/09/03 20:58:36  thomson
00021  * *** empty log message ***
00022  *
00023  * Revision 1.6  2004/06/04 21:02:45  thomson
00024  * *** empty log message ***
00025  *
00026  * Revision 1.5  2004/06/04 16:55:27  thomson
00027  * *** empty log message ***
00028  *
00029  * Revision 1.4  2004/05/23 19:12:34  thomson
00030  * *** empty log message ***
00031  *
00032  * Revision 1.3  2004/04/10 12:18:01  thomson
00033  * Numerous fixes: LogName, LogMode options added, dns-servers changed to
00034  * dns-server, '' around strings are no longer needed.
00035  *
00036  * Revision 1.2  2004/03/29 22:06:49  thomson
00037  * 0.1.1 version
00038  *
00039  *
00040  * Released under GNU GPL v2 licence
00041  *
00042  */
00043 
00044 #ifndef LOGGER_H
00045 #define LOGGER_H
00046 #include <iostream>
00047 #include <string>
00048 #include "DHCPConst.h"
00049 
00050 #define Log(X) logger :: log##X ()
00051 #define LogEnd logger :: endl
00052 
00053 namespace logger {
00054 
00055     enum Elogmode {
00056         FULL,
00057         SHORT,
00058         SYSLOG,
00059         EVENTLOG
00060     };
00061 
00062     using namespace std;
00063     ostream& logCont();
00064     ostream& logEmerg();
00065     ostream& logAlert();
00066     ostream& logCrit();
00067     ostream& logError();
00068     ostream& logWarning();
00069     ostream& logNotice();
00070     ostream& logInfo();
00071     ostream& logDebug();
00072 
00073     void Initialize(char * file);
00074     void Terminate();
00075     void setLogName(string x);
00076     void setLogLevel(int x);
00077     void setLogMode(string x);
00078     void EchoOff();
00079     void EchoOn();
00080     
00081     ostream & endl (ostream & strum);
00082 
00083 }
00084 
00085 std::string StateToString(EState state);
00086 std::string StatusCodeToString(int status);
00087 
00088 #endif
00089 

Generated on Mon Dec 27 21:55:22 2004 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1