src/log.c File Reference

Logging functions for hcap (not an access log). More...

Typedefs

typedef enum log_level log_level_e

Enumerations

enum  log_level { LL_MESSAGE = 0, LL_WARNING, LL_ERROR, LL_DEBUG }

Functions

bool log_module_init (void)
 Initialise the logging module.
void log_message (const char *format,...)
 Log a message to the log.
void log_debug_message (const char *format,...)
 Log a debug message to the log.
void log_warning (const char *format,...)
 Log a warning to the log.
void log_fatal (const char *format,...)
 Log a message, print an error to stderr and exit(EXIT_FAILURE).
void log_module_close (void)
 Close the log file that was opened with log_open().

Detailed Description

Logging functions for hcap (not an access log).

Date:
1 Jan 2010
Author:
Zachary Sims <zacs7@users.sourceforge.net>

Module prefix: log_

Id
log.c 240 2010-02-14 03:16:31Z zacs7

Typedef Documentation

typedef enum log_level log_level_e

Enumeration Type Documentation

enum log_level
Enumerator:
LL_MESSAGE 
LL_WARNING 
LL_ERROR 
LL_DEBUG 

Function Documentation

void log_debug_message ( const char *  format,
  ... 
)

Log a debug message to the log.

The message is repeated on stderr. The format follows printf().

Parameters:
format The formatting of the log message, see printf().
void log_fatal ( const char *  format,
  ... 
)

Log a message, print an error to stderr and exit(EXIT_FAILURE).

Note that registered atexit() functions will be called.

Parameters:
format The formatting of the log message, see printf().
void log_message ( const char *  format,
  ... 
)

Log a message to the log.

Follows the same syntax as printf().

Parameters:
format The formatting of the log message, see printf().
void log_module_close ( void   ) 

Close the log file that was opened with log_open().

See also:
log_module_init()
bool log_module_init ( void   ) 

Initialise the logging module.

See also:
log_module_close()
Returns:
true on success. On error, false is returned.
void log_warning ( const char *  format,
  ... 
)

Log a warning to the log.

Follows the same syntax as printf().

Parameters:
format The formatting of the log message, see printf().

Generated by  doxygen 1.6.2