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

y2log.h File Reference

#include <string>
#include <stdio.h>

Go to the source code of this file.

Defines

#define y2log_suffix
#define y2log_prefix   ""
#define y2_logger(level, comp, file, line, function, format, args...)
#define y2_vlogger(level, comp, file, line, function, format, args)
#define y2logger(level, format, args...)   y2_logger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,##args)
#define y2vlogger(level, format, ap)   y2_vlogger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,ap)
#define y2debug(format, args...)   y2logger(LOG_DEBUG,format,##args)
#define y2milestone(format, args...)   y2logger(LOG_MILESTONE,format,##args)
#define y2warning(format, args...)   y2logger(LOG_WARNING,format,##args)
#define y2error(format, args...)   y2logger(LOG_ERROR,format,##args)
#define y2security(format, args...)   y2logger(LOG_SECURITY,format,##args)
#define y2internal(format, args...)   y2logger(LOG_INTERNAL,format,##args)

Enumerations

enum  loglevel_t {
  LOG_DEBUG = 0, LOG_MILESTONE = 1, LOG_WARNING = 2, LOG_ERROR = 3,
  LOG_SECURITY = 4, LOG_INTERNAL = 5
}

Functions

void y2_logger_function (loglevel_t level, const char *component, const char *file, const int line, const char *func, const char *format,...) __attribute__((format(printf
void y2_vlogger_function (loglevel_t level, const char *component, const char *file, const int line, const char *func, const char *format, va_list ap)
bool should_be_logged (int loglevel, string componentname)
void set_log_filename (string filename)
string get_log_filename ()
void set_log_conf (string confname)
void set_log_simple_mode (bool simple)
void set_log_debug (bool on=true)
bool get_log_debug ()


Define Documentation

#define y2_logger level,
comp,
file,
line,
function,
format,
args...   ) 
 

Value:

do {                                                                    \
    if (should_be_logged (level, comp))                                 \
        y2_logger_function (level,comp,file,line,function,format,##args);\
} while (0)

#define y2_vlogger level,
comp,
file,
line,
function,
format,
args   ) 
 

Value:

do {                                                                    \
    if (should_be_logged (level, comp))                                 \
        y2_vlogger_function (level,comp,file,line,function,format,args);\
} while (0)

#define y2debug format,
args...   )     y2logger(LOG_DEBUG,format,##args)
 

#define y2error format,
args...   )     y2logger(LOG_ERROR,format,##args)
 

#define y2internal format,
args...   )     y2logger(LOG_INTERNAL,format,##args)
 

#define y2log_prefix   ""
 

#define y2log_suffix
 

#define y2logger level,
format,
args...   )     y2_logger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,##args)
 

#define y2milestone format,
args...   )     y2logger(LOG_MILESTONE,format,##args)
 

#define y2security format,
args...   )     y2logger(LOG_SECURITY,format,##args)
 

#define y2vlogger level,
format,
ap   )     y2_vlogger(level,y2log_prefix,__FILE__,__LINE__,__FUNCTION__,format,ap)
 

#define y2warning format,
args...   )     y2logger(LOG_WARNING,format,##args)
 


Enumeration Type Documentation

enum loglevel_t
 

Enumeration values:
LOG_DEBUG 
LOG_MILESTONE 
LOG_WARNING 
LOG_ERROR 
LOG_SECURITY 
LOG_INTERNAL 


Function Documentation

bool get_log_debug  ) 
 

whether debug logging is enabled

string get_log_filename  ) 
 

Logfile name reporting

void set_log_conf string  confname  ) 
 

Parse the log.conf

void set_log_debug bool  on = true  ) 
 

enable or disable debug logging

Parameters:
on true for on

void set_log_filename string  fname  ) 
 

Logfile name initialization

void set_log_simple_mode bool  simple  ) 
 

Set (or reset) the simple mode

bool should_be_logged int  loglevel,
string  componentname
 

Test if we should create a log entry

void y2_logger_function loglevel_t  level,
const char *  component,
const char *  file,
const int  line,
const char *  func,
const char *  format,
  ...
 

void y2_vlogger_function loglevel_t  level,
const char *  component,
const char *  file,
const int  line,
const char *  function,
const char *  format,
va_list  ap
 

The universal logger function


Generated on Thu Feb 23 23:56:10 2006 for liby2util by doxygen 1.3.6