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 CDDB_LOG_H |
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.
level | The log level. | |
message | The log message. |
enum cddb_log_level_t |
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.
new_handler | The new 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.
level | The minimum log level. |