Main Page | Class List | File List | Class Members | File Members | Related Pages

log.h File Reference

Log debugging, warning and error messages. More...

#include <syslog.h>

Go to the source code of this file.

Defines

#define LOG_PERROR   0x20
#define LOG_PFX   NULL
#define LOG_USER   (1 << 31)
#define LOG_EMERG   0 /* system is unusable */
#define LOG_ALERT   1 /* action must be taken immediately */
#define LOG_CRIT   2 /* critical conditions */
#define LOG_ERR   3 /* error conditions */
#define LOG_WARNING   4 /* warning conditions */
#define LOG_NOTICE   5 /* normal but significant condition */
#define LOG_INFO   6 /* informational */
#define LOG_DEBUG   7 /* debug-level messages */
#define GIFT_INFO(args)   (log_info args)
#define GIFT_WARN(args)   (log_warn args)
#define GIFT_ERROR(args)   (log_error args)
#define GIFT_FATAL(args)   (log_fatal args), exit(0)
#define GIFT_ERRNO()   (platform_errno())
#define GIFT_STRERROR()   (platform_error())
#define GIFT_NETERROR()   (platform_net_error())
#define GIFT_DBG(args)
#define GIFT_TRACE(args)
#define GIFT_TRACEFN
#define GIFT_TRACEMEM(ptr, len)
#define GLOG_DEBUG
#define GLOG_DEFAULT   GLOG_FILE
#define GIFT_FMTATTR(f, v)

Enumerations

enum  LogOptions {
  GLOG_NONE = 0x00, GLOG_STDERR = 0x01, GLOG_STDOUT = 0x02, GLOG_SYSLOG = 0x04,
  GLOG_FILE = 0x08, GLOG_DEBUGGER = 0x10
}

Functions

EXTERN_C_BEGIN LIBGIFT_EXPORT
int 
log_init (LogOptions options, char *ident, int syslog_option, int facility, char *log_file)
LIBGIFT_EXPORT void log_cleanup ()
LIBGIFT_EXPORT void log_print (int priority, char *msg)
LIBGIFT_EXPORT void log_info (const char *fmt,...) GIFT_FMTATTR(1
LIBGIFT_EXPORT void log_warn (const char *fmt,...) GIFT_FMTATTR(1
LIBGIFT_EXPORT void log_error (const char *fmt,...) GIFT_FMTATTR(1
LIBGIFT_EXPORT void log_fatal (const char *fmt,...) GIFT_FMTATTR(1


Detailed Description

Log debugging, warning and error messages.

These logging facilities provide greater control over the end output location, whether it be to stdout/stderr, a simple log file, or even syslog facilities.


Function Documentation

LIBGIFT_EXPORT void log_cleanup  ) 
 

Cleanup the log subsystem

EXTERN_C_BEGIN LIBGIFT_EXPORT int log_init LogOptions  options,
char *  ident,
int  syslog_option,
int  facility,
char *  log_file
 

Initialize the log subsystem

Parameters:
options 
ident 
syslog_option 
facility 
log_file 
Return values:
TRUE Successful initialization
FALSE Unable to load logging subsystem

LIBGIFT_EXPORT void log_print int  priority,
char *  msg
 

Direct interface to the log printing facility. Avoid using this at all costs.


Generated on Sun Aug 22 08:07:11 2004 by doxygen 1.3.7