Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

Logging system
[HAL daemon]

Logging system for the HAL daemon. More...

Defines

#define HAL_TRACE(expr)   do {;} while(0)
#define HAL_DEBUG(expr)   do {;} while(0)
#define HAL_INFO(expr)   do {;} while(0)
#define HAL_WARNING(expr)   do {logger_setup(HAL_LOGPRI_WARNING, __FILE__, __LINE__, __FUNCTION__); logger_emit expr; } while(0)
#define HAL_ERROR(expr)   do {logger_setup(HAL_LOGPRI_ERROR, __FILE__, __LINE__, __FUNCTION__); logger_emit expr; } while(0)
#define DIE(expr)   do {printf("*** [DIE] %s:%s():%d : ", __FILE__, __FUNCTION__, __LINE__); printf expr; printf("\n"); exit(1); } while(0)

Enumerations

enum  {
  HAL_LOGPRI_TRACE = (1 << 0), HAL_LOGPRI_DEBUG = (1 << 1), HAL_LOGPRI_INFO = (1 << 2), HAL_LOGPRI_WARNING = (1 << 3),
  HAL_LOGPRI_ERROR = (1 << 4)
}
 Logging levels for HAL daemon. More...


Functions

void logger_init ()
 Initialize logging system.

void logger_setup (int _priority, const char *_file, int _line, const char *_function)
 Setup logging entry.

void logger_emit (const char *format,...)
 Emit logging entry.


Variables

int priority
const char * file
int line
const char * function

Detailed Description

Logging system for the HAL daemon.


Enumeration Type Documentation

anonymous enum
 

Logging levels for HAL daemon.

Enumeration values:
HAL_LOGPRI_TRACE  function call sequences
HAL_LOGPRI_DEBUG  debug statements in code
HAL_LOGPRI_INFO  informational level
HAL_LOGPRI_WARNING  warnings
HAL_LOGPRI_ERROR  error

Definition at line 38 of file logger.h.


Function Documentation

void logger_emit const char *  format,
  ...
 

Emit logging entry.

Parameters:
format Message format string, printf style
... Parameters for message, printf style

Todo:
Make programmatic interface to logging

Definition at line 81 of file logger.c.

References HAL_LOGPRI_DEBUG, HAL_LOGPRI_ERROR, HAL_LOGPRI_INFO, HAL_LOGPRI_TRACE, and HAL_LOGPRI_WARNING.

void logger_setup int  priority,
const char *  file,
int  line,
const char *  function
 

Setup logging entry.

Parameters:
priority Logging priority, one of HAL_LOGPRI_*
file Name of file where the log entry originated
line Line number of file
function Name of function

Definition at line 66 of file logger.c.


Generated on Thu Mar 11 21:32:25 2004 for HAL by doxygen 1.3.6-20040222