libdali 1.8.0
The DataLink client library
|
Central logging functions for the library and calling programs. More...
Data Structures | |
struct | DLLog |
Functions | |
int | dl_log (int level, int verb, const char *format,...) |
Log a message using the global logging parameters. | |
int | dl_log_r (const DLCP *dlconn, int level, int verb, const char *format,...) |
Log a message using the log parameters from a DLCP. | |
int | dl_log_rl (DLLog *log, int level, int verb, const char *format,...) |
Log a message using the log parameters from a DLCP. | |
void | dl_loginit (int verbosity, void(*log_print)(char *), const char *logprefix, void(*diag_print)(char *), const char *errprefix) |
Initialize global logging system parameters. | |
void | dl_loginit_r (DLCP *dlconn, int verbosity, void(*log_print)(char *), const char *logprefix, void(*diag_print)(char *), const char *errprefix) |
Initialize logging parameters specific to a DLCP. | |
DLLog * | dl_loginit_rl (DLLog *log, int verbosity, void(*log_print)(char *), const char *logprefix, void(*diag_print)(char *), const char *errprefix) |
Initialize logging parameters for a specific DLLog. | |
Central logging functions for the library and calling programs.
This central logging facility is used for all logging performed by the library.
The logging can be configured to send messages to arbitrary functions, referred to as log_print()
and diag_print()
. This allows output to be re-directed to other logging systems if needed.
It is also possible to assign prefixes to log messages for identification, referred to as logprefix
and errprefix
.
Three message levels are recognized:
log_print()
with logprefix
diag_print()
with logprefix
diag_print()
with errprefix
It is the task of the ms_log()
and ms_log_l()
functions to format a message using printf conventions and pass the formatted string to the appropriate printing function.
int dl_log | ( | int | level, |
int | verb, | ||
const char * | format, | ||
... | |||
) |
Log a message using the global logging parameters.
A wrapper to dl_log_main() that uses the global logging parameters.
level | Level at which to log the message (1, 2 or 3) |
verb | Verbosity threshold at which to log the message |
format | Message format in printf() style |
... | Message format variables |
int dl_log_r | ( | const DLCP * | dlconn, |
int | level, | ||
int | verb, | ||
const char * | format, | ||
... | |||
) |
Log a message using the log parameters from a DLCP.
A wrapper to dl_log_main() that uses the logging parameters in a supplied DLCP. If the supplied pointer is NULL the global logging parameters will be used.
dlconn | DataLink Connection Parameters with associated logging paramters |
level | Level at which to log the message (1, 2 or 3) |
verb | Verbosity threshold at which to log the message |
format | Message format in printf() style |
... | Message format variables |
int dl_log_rl | ( | DLLog * | log, |
int | level, | ||
int | verb, | ||
const char * | format, | ||
... | |||
) |
Log a message using the log parameters from a DLCP.
A wrapper to dl_log_main() that uses the logging parameters in a supplied DLLog. If the supplied pointer is NULL the global logging parameters will be used.
log | DLLog logging paramters |
level | Level at which to log the message (1, 2 or 3) |
verb | Verbosity threshold at which to log the message |
format | Message format in printf() style |
... | Message format variables |
void dl_loginit | ( | int | verbosity, |
void(*)(char *) | log_print, | ||
const char * | logprefix, | ||
void(*)(char *) | diag_print, | ||
const char * | errprefix | ||
) |
Initialize global logging system parameters.
Initialize the global logging parameters.
See dl_loginit_main() description for usage.
void dl_loginit_r | ( | DLCP * | dlconn, |
int | verbosity, | ||
void(*)(char *) | log_print, | ||
const char * | logprefix, | ||
void(*)(char *) | diag_print, | ||
const char * | errprefix | ||
) |
Initialize logging parameters specific to a DLCP.
Initialize DLCP specific logging parameters. If the logging parameters have not been initialized (dlconn->log == NULL) new parameter space will be allocated.
See dl_loginit_main() description for usage.
DLLog * dl_loginit_rl | ( | DLLog * | log, |
int | verbosity, | ||
void(*)(char *) | log_print, | ||
const char * | logprefix, | ||
void(*)(char *) | diag_print, | ||
const char * | errprefix | ||
) |
Initialize logging parameters for a specific DLLog.
Initialize DLLog specific logging parameters. If the logging parameters have not been initialized (log == NULL) new parameter space will be allocated.
See dl_loginit_main() description for usage.