Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

log.h File Reference

Implements logging function. More...

Go to the source code of this file.

Wrappers

After including log.h you have to define the current zone with the following statement:
#define LOG_ZONE "CURRENT ZONE"


#define LOGIT(b...)   {logit(b);}
 Wrapper for logging.

#define LOG_INIT(logfile, sysmode)   {log_init(logfile,sysmode);}
 Wrapper for module init.

#define LOG_END()   {log_end();}
 Wrapper for module shutdown.

#define MALLOC_CHECK(p)
 overrides MALLOC_CHECK

#define ERROR_ABORT(a)
 overrides ERROR_ABORT

#define ERROR_PRINT(a)
 overrides ERROR_PRINT

#define DBG(a...)
 DBG needs -v -v.

#define SAY(a...)
 SAY needs -v.


Defines

#define MAX_LOG_SIZE   3000000
 max logfile size in bytes

#define MAX_LOG_STRING   1000
 len of the log string


Functions

int logit (char *zone, char *str,...)
 log in a pretty way

int log_init (char *logfile, int syslogmode)
 initialize the log module

int log_end (void)
 shut down the module

int log_get_verbosity (void)
 get verbosity level

void log_set_verbosity (int v)
 set verbosity level

int log_rotate (char *logfile)
char * log_get_logfile (void)


Detailed Description

Implements logging function.

Author:
Simone Vellei   <sorry guy>

Definition in file log.h.


Define Documentation

#define DBG a...   ) 
 

Value:

{\
        if (log_get_verbosity() >= 2) {\
                LOGIT(LOG_ZONE,"DBG(%s,%4d): ",\
                        __FILE__,__LINE__);\
                LOGIT(LOG_ZONE,a);\
        }\
}
DBG needs -v -v.

Definition at line 60 of file log.h.

#define ERROR_ABORT  ) 
 

Value:

{\
        LOGIT(LOG_ZONE,"ABORT(%s,%4d): %s",__FILE__,__LINE__,a);\
        abort();\
}
overrides ERROR_ABORT

Definition at line 51 of file log.h.

#define ERROR_PRINT  ) 
 

Value:

{\
        LOGIT(LOG_ZONE,"ERROR(%s,%4d): %s",__FILE__,__LINE__,a);\
}
overrides ERROR_PRINT

Definition at line 56 of file log.h.

 
#define LOG_END  )     {log_end();}
 

Wrapper for module shutdown.

Definition at line 44 of file log.h.

#define LOG_INIT logfile,
sysmode   )     {log_init(logfile,sysmode);}
 

Wrapper for module init.

Definition at line 42 of file log.h.

#define LOGIT b...   )     {logit(b);}
 

Wrapper for logging.

Definition at line 40 of file log.h.

#define MALLOC_CHECK  ) 
 

Value:

{\
        if(p == NULL) \
                ERROR_ABORT("Unable to malloc\n");\
}
overrides MALLOC_CHECK

Definition at line 46 of file log.h.

#define MAX_LOG_SIZE   3000000
 

max logfile size in bytes

Definition at line 76 of file log.h.

#define MAX_LOG_STRING   1000
 

len of the log string

Definition at line 79 of file log.h.

#define SAY a...   ) 
 

Value:

{\
        if (log_get_verbosity() >= 1) {\
                LOGIT(LOG_ZONE,a);\
        }\
}
SAY needs -v.

Definition at line 68 of file log.h.


Function Documentation

int log_end void   ) 
 

shut down the module

char* log_get_logfile void   ) 
 

int log_get_verbosity void   ) 
 

get verbosity level

int log_init char *  logfile,
int  syslogmode
 

initialize the log module

int log_rotate char *  logfile  ) 
 

void log_set_verbosity int  v  ) 
 

set verbosity level

int logit char *  zone,
char *  str,
  ...
 

log in a pretty way

Parameters:
zone will be prepended
str printf like syntax
Returns:
0 on success


Generated on Wed May 5 15:48:04 2004 for LiberoPOPs by doxygen 1.3.6-20040222