Functions | |
cx_log_level_flags | cx_log_set_always_fatal (cx_log_level_flags mask) |
Set log levels to be always fatal. | |
cxsize | cx_log_get_domain_count (void) |
Get the number of registered log domains. | |
const cxchar * | cx_log_get_domain_name (cxsize position) |
Get the name of a log domain. | |
cx_log_level_flags | cx_log_set_fatal_mask (const cxchar *name, cx_log_level_flags fatal_mask) |
Sets the log message level which are fatal for a given domain. | |
cx_log_func | cx_log_set_default_handler (cx_log_func func) |
Set the default log handler. | |
cxuint | cx_log_set_handler (const cxchar *name, cx_log_level_flags levels, cx_log_func func, cxptr data) |
Set the log handler for a log domain. | |
void | cx_log_remove_handler (const cxchar *name, cxuint id) |
Remove a log handler from a domain. | |
void | cx_logv (const cxchar *name, cx_log_level_flags level, const cxchar *format, va_list args) |
Log a formatted message using a variable-length argument. | |
void | cx_log (const cxchar *name, cx_log_level_flags level, const cxchar *format,...) |
Log a formatted message. | |
void | cx_log_default_handler (const cxchar *name, cx_log_level_flags level, const cxchar *message, cxptr data) |
Default log handler. | |
cx_print_func | cx_print_set_handler (cx_print_func func) |
Set handler for message output. | |
void | cx_print (const cxchar *format,...) |
Output a formatted message via the print handler. | |
cx_print_func | cx_printerr_set_handler (cx_print_func func) |
Set handler for error message output. | |
void | cx_printerr (const cxchar *format,...) |
Output a formatted message via the error message handler. | |
void | cx_error (const cxchar *format,...) |
Log an error message. | |
void | cx_critical (const cxchar *format,...) |
Log a "critical" warning. | |
void | cx_warning (const cxchar *format,...) |
Log a warning. | |
void | cx_message (const cxchar *format,...) |
Log a normal message. |
#include <cxmessages.h>
void cx_critical | ( | const cxchar * | format, | |
... | ||||
) |
Log a "critical" warning.
format | The format string. | |
... | Arguments to be inserted into the format string. |
CX_LOG_LEVEL_CRITICAL
, as specified by the format string format and the following list of arguments, via the installed log handler.It is up to the application to decide which warnings are critical and which are not. To cause a termination of the application on critical warnings you may call cx_log_set_always_fatal().
void cx_error | ( | const cxchar * | format, | |
... | ||||
) |
Log an error message.
format | The format string. | |
... | Arguments to be inserted into the format string. |
Error messages are always considered fatal, i.e. the application is immediately terminated by a call to abort() causing a core dump. Do not use this function for expected (recoverable) errors. This function should be used to indicate a bug (assertion failure) in the application.
void cx_log | ( | const cxchar * | name, | |
cx_log_level_flags | level, | |||
const cxchar * | format, | |||
... | ||||
) |
Log a formatted message.
name | Name of the log domain. | |
level | The message log level. | |
format | Format string defining output converstions. | |
... | Argument list. |
void cx_log_default_handler | ( | const cxchar * | name, | |
cx_log_level_flags | level, | |||
const cxchar * | message, | |||
cxptr | data | |||
) |
Default log handler.
name | The message's log domain name | |
level | Log level of the message | |
message | The message text | |
data | Extra data passed by the caller (ignored!) |
stdout
, or stderr
if the level is one of CX_LOG_LEVEL_ERROR
, CX_LOG_LEVEL_CRITICAL
and CX_LOG_LEVEL_WARNING
. In addition, if the log level is fatal the program is aborted by a call to abort().
cxsize cx_log_get_domain_count | ( | void | ) |
Get the number of registered log domains.
const cxchar* cx_log_get_domain_name | ( | cxsize | position | ) |
Get the name of a log domain.
position | Index of the log domain to lookup. |
NULL
if position is out of range.NULL
.
void cx_log_remove_handler | ( | const cxchar * | name, | |
cxuint | id | |||
) |
Remove a log handler from a domain.
name | Name of the log domain. | |
id | Id number of the handler. |
cx_log_level_flags cx_log_set_always_fatal | ( | cx_log_level_flags | mask | ) |
Set log levels to be always fatal.
mask | Log message level flags. |
In any case, the function forces errors to be fatal even if the error level was not set in mask. The priviously set mask is replaced by mask and is passed back to the caller as the return value.
cx_log_func cx_log_set_default_handler | ( | cx_log_func | func | ) |
Set the default log handler.
func | New handler function. |
cx_log_level_flags cx_log_set_fatal_mask | ( | const cxchar * | name, | |
cx_log_level_flags | fatal_mask | |||
) |
Sets the log message level which are fatal for a given domain.
name | Name of the log domain. | |
fatal_mask | The log domains new fatal mask. |
cxuint cx_log_set_handler | ( | const cxchar * | name, | |
cx_log_level_flags | levels, | |||
cx_log_func | func, | |||
cxptr | data | |||
) |
Set the log handler for a log domain.
name | Name of the log domain. | |
levels | Log levels. | |
func | log function. | |
data | User data. |
void cx_logv | ( | const cxchar * | name, | |
cx_log_level_flags | level, | |||
const cxchar * | format, | |||
va_list | args | |||
) |
Log a formatted message using a variable-length argument.
name | Name of the log domain. | |
level | The message log level. | |
format | Format string defining output converstions. | |
args | Variable-length argument list. |
The formatted message is logged for the level level, if it is enabled, using the log function set for the log domain name.
void cx_message | ( | const cxchar * | format, | |
... | ||||
) |
Log a normal message.
format | The format string. | |
... | Arguments to be inserted into the format string. |
void cx_print | ( | const cxchar * | format, | |
... | ||||
) |
Output a formatted message via the print handler.
format | The message format. | |
... | Argument list. |
stdout
.The cx_print() function should not be from within libraries for debugging messages, since it may be redirected by applications. Instead, libraries should use cx_log(), or the convenience functions cx_error(), cx_critical(), cx_warning() and cx_message().
cx_print_func cx_print_set_handler | ( | cx_print_func | func | ) |
Set handler for message output.
func | New handler function. |
stdout
.
void cx_printerr | ( | const cxchar * | format, | |
... | ||||
) |
Output a formatted message via the error message handler.
format | The message format. | |
... | Argument list. |
stderr
.The cx_printerr() function should not be from within libraries for debugging messages, since it may be redirected by applications. Instead, libraries should use cx_log(), or the convenience functions cx_error(), cx_critical(), cx_warning() and cx_message().
cx_print_func cx_printerr_set_handler | ( | cx_print_func | func | ) |
Set handler for error message output.
func | New handler function. |
stderr
.
void cx_warning | ( | const cxchar * | format, | |
... | ||||
) |
Log a warning.
format | The format string. | |
... | Arguments to be inserted into the format string. |