Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

loghandler.h

Go to the documentation of this file.
00001 #ifndef LOGHANDLER_H
00002 #define LOGHANDLER_H
00003 
00004 /* Default config */
00005 #define DEFAULT_LOGDEVICE "/tmp/loghandler.log"
00006 #define DEFAULT_LOGLEVEL  LOG_NORMAL
00007 #define DEFAULT_LOGCLASS  MAIN_LOG
00008 #define DEFAULT_LOGFORMAT SHOW_ALL
00009 
00010 /* Defs */
00011 #define LOGHANDLER_VERSION 0.2.4
00012 #define LOGHANDLER_DATE    __DATE__
00013 #define LOGMSG_MAX    256
00014 #define LOGHANDLE_MAX 5
00015 
00016 /* Log format */
00017 #define SHOW_YEAR   1
00018 #define SHOW_DATE   2
00019 #define SHOW_TIME   4
00020 #define SHOW_CLASS  8
00021 #define SHOW_LEVEL 16
00022 #define SHOW_ID    32
00023 #define SHOW_ALL  255
00024 
00025 /* Log event */
00026 #define LOG_MARK    0      // Will always be logged
00027 #define LOG_FATAL   1      // Application can not continue
00028 #define LOG_ERROR   2      // Serious error
00029 #define LOG_WARNING 3      // May cause problems
00030 #define LOG_NORMAL  4      // Normal production
00031 #define LOG_NOTICE  5      // May be of interest 
00032 #define LOG_INFO    6      // Additional information
00033 #define LOG_VERBOSE 7      // May cause lots of output
00034 
00035 /* Debug event */
00036 #define D_CHECK   8      // Check point
00037 #define D_LOGIC   9      // Logic condition
00038 #define D_ERR     10     // Error
00039 #define D_WARN    11     // Warning
00040 #define D_FUNC    12     // Entering or leaving function
00041 #define D_VAR     13     // Varible values
00042 #define D_IO      14     // Input/Output to file or command
00043 #define D_TRACE   15     // Heavy tracing
00044 
00045 /* Log class */
00046 #define DEBUG_LOG     8    // For developing
00047 #define MAIN_LOG     16    // General application
00048 #define USER_LOG     32    // User related
00049 #define SYS_LOG      64    // System related
00050 #define NET_LOG     128    // Network related
00051 #define GLOBAL_LOG  241    // All logs except debug
00052 
00053 /* Recorders */
00054 extern void logf(int logcode, const char *msg, ...);
00055 extern void debugf(int logcode, const char *msg, ...);
00056 extern void loghandler(int loglevel, int logclass, const char *msg, ...);
00057 
00058 /* Control */
00059 extern int loghandler_init(int id, const char *logdevice, int logclass, int loglevel, int logformat);
00060 extern int loghandler_init(int id, const char *logdevice);
00061 extern int loghandler_setlevel(int id, int loglevel);
00062 extern int loghandler_getlevel(int id);
00063 extern int loghandler_setclass(int id, int logclass);
00064 extern int loghandler_getclass(int id);
00065 
00066 #endif
00067 

Generated at Mon Jan 22 08:35:12 2001 for ldapconf by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000