|
DTNMA Reference Tools v2.1.0 - 2.ga9a44fe
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
Abstract interface for event logging. More...
#include <syslog.h>#include <stdbool.h>
Include dependency graph for logging.h:Macros | |
| #define | CACE_LOG_CRIT(...) cace_log(LOG_CRIT, __FILE__, __LINE__, __func__, __VA_ARGS__) |
| Perform LOG_CRIT level logging with auto-filled parameters. | |
| #define | CACE_LOG_ERR(...) cace_log(LOG_ERR, __FILE__, __LINE__, __func__, __VA_ARGS__) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| #define | CACE_LOG_WARNING(...) cace_log(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| #define | CACE_LOG_INFO(...) cace_log(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| #define | CACE_LOG_DEBUG(...) cace_log(LOG_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Functions | |
| void | cace_openlog (void) |
| Opens the event log. | |
| void | cace_closelog (void) |
| Closes the event log. | |
| int | cace_log_get_severity (int *severity, const char *name) |
| Interpret a text name as a severity level. | |
| void | cace_log_set_least_severity (int severity) |
| Set the least severity enabled for logging. | |
| bool | cace_log_is_enabled_for (int severity) |
| Determine if a particular severity is being logged. | |
| void | cace_log (int severity, const char *filename, int lineno, const char *funcname, const char *format,...) |
| Log an event. | |
Abstract interface for event logging.
| #define CACE_LOG_CRIT | ( | ... | ) | cace_log(LOG_CRIT, __FILE__, __LINE__, __func__, __VA_ARGS__) |
Perform LOG_CRIT level logging with auto-filled parameters.
The arguments to this macro are passed to cace_log() as the format and its parameter values.
| void cace_closelog | ( | void | ) |
Closes the event log.
This is a mimic to POSIX closelog()
References cace_log_event_t::message, and cace_log_event_t::severity.
| void cace_log | ( | int | severity, |
| const char * | filename, | ||
| int | lineno, | ||
| const char * | funcname, | ||
| const char * | format, | ||
| ... | |||
| ) |
Log an event.
| severity | The severity from a subset of the POSIX syslog values. | |
| [in] | filename | The originating file name, which may include directory parts. |
| [in] | lineno | The originating file line number. |
| [in] | funcname | The originating function name. |
| [in] | format | The log message format string. |
| ... | Values for the format string. |
References cace_log_is_enabled_for(), cace_log_event_t::context, cace_log_event_t::message, and cace_log_event_t::severity.
| int cace_log_get_severity | ( | int * | severity, |
| const char * | name | ||
| ) |
Interpret a text name as a severity level.
| [out] | severity | The associated severity level. |
| [in] | name | The text name, which is case insensitive. |
References CHKERR1.
| bool cace_log_is_enabled_for | ( | int | severity | ) |
Determine if a particular severity is being logged.
This function is multi-thread safe.
| severity | The severity from a subset of the POSIX syslog values. |
Referenced by cace_amp_msg_decode(), cace_amp_msg_encode(), cace_amp_proxy_cli_recv(), cace_amp_proxy_msg_recv(), cace_log(), and refdm_db_insert_rptset().
| void cace_log_set_least_severity | ( | int | severity | ) |
Set the least severity enabled for logging.
Other events will be dropped by the logging facility. This function is multi-thread safe.
| severity | The severity from a subset of the POSIX syslog values. |
| void cace_openlog | ( | void | ) |
Opens the event log.
This is a mimic to POSIX openlog()
References cace_log_event_t::message, and cace_log_event_t::severity.