cddb_log.h File Reference

Go to the source code of this file.

Defines

#define CDDB_LOG_H

Typedefs

typedef void(* cddb_log_handler_t )(cddb_log_level_t level, const char *message)
 This type defines the signature of a libcddb log handler.

Enumerations

enum  cddb_log_level_t {
  CDDB_LOG_DEBUG = 1, CDDB_LOG_INFO, CDDB_LOG_WARN, CDDB_LOG_ERROR,
  CDDB_LOG_CRITICAL, CDDB_LOG_NONE = 99
}
 The different log levels supported by libcddb. More...

Functions

cddb_log_handler_t cddb_log_set_handler (cddb_log_handler_t new_handler)
 Set a custom log handler for libcddb.
void cddb_log_set_level (cddb_log_level_t level)
 Set the minimum log level.


Define Documentation

#define CDDB_LOG_H
 


Typedef Documentation

typedef void(* cddb_log_handler_t)(cddb_log_level_t level, const char *message)
 

This type defines the signature of a libcddb log handler.

For every message being logged by libcddb, the handler will receive the log level and the message string.

See also:
cddb_log_set_handler

cddb_log_level_t

Parameters:
level The log level.
message The log message.


Enumeration Type Documentation

enum cddb_log_level_t
 

The different log levels supported by libcddb.

Enumerator:
CDDB_LOG_DEBUG  Debug-level messages.
CDDB_LOG_INFO  Informational.
CDDB_LOG_WARN  Warning conditions.
CDDB_LOG_ERROR  Error conditions.
CDDB_LOG_CRITICAL  Critical conditions.
CDDB_LOG_NONE  No log messages.


Function Documentation

cddb_log_handler_t cddb_log_set_handler cddb_log_handler_t  new_handler  ) 
 

Set a custom log handler for libcddb.

The return value is the log handler being replaced. If the provided parameter is NULL, then the handler will be reset to the default handler.

See also:
cddb_log_handler_t
Parameters:
new_handler The new log handler.
Returns:
The previous log handler.

void cddb_log_set_level cddb_log_level_t  level  ) 
 

Set the minimum log level.

This function is only useful in conjunction with the default log handler. The default log handler will print any log messages that have a log level equal or higher than this minimum log level to stderr. By default the minimum log level is set to CDDB_LOG_WARN. This means that only warning, error and critical messages will be printed. You can silence the default log handler by setting the minimum log level to CDDB_LOG_NONE.

See also:
cddb_log_level_t
Parameters:
level The minimum log level.


Generated on Sun Oct 15 14:49:15 2006 for libcddb by  doxygen 1.4.6