|
DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
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.
| #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.
| #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_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_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.
| void cace_closelog | ( | void | ) |
Closes the event log.
This is a mimic to POSIX closelog()
References cace_log_event_deinit(), cace_log_event_init(), event_queue, cace_log_event_t::message, cace_log_event_t::severity, thr_sink, thr_valid, and write_log().
Referenced by main(), and suiteTearDown().
| 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_event_deinit(), cace_log_event_init(), cace_log_is_enabled_for(), cace_log_event_t::context, did_crit, event_queue, cace_log_event_t::message, cace_log_event_t::severity, thr_valid, va_end(), va_start(), and write_log().
| 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, and sev_names.
Referenced by main(), and mgr_parse_args().
| 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. |
References least_severity.
Referenced by agentParseHex(), cace_amm_actual_param_set_populate(), cace_amm_obj_ns_add_obj(), cace_amm_semtype_tblt_match(), cace_amm_semtype_union_convert(), cace_amp_msg_decode(), cace_amp_msg_encode(), cace_amp_proxy_cli_recv(), cace_amp_proxy_msg_recv(), cace_log(), refda_acl_search_endpoint(), refda_acl_search_permission(), refda_adm_ietf_dtnma_agent_ctrl_ensure_const(), refda_adm_ietf_dtnma_agent_ctrl_ensure_var(), refda_adm_ietf_dtnma_agent_ctrl_var_reset(), refda_adm_ietf_dtnma_agent_ctrl_var_store(), refda_binding_ident_bases(), refda_binding_semtype_use(), refda_ctrl_exec_ctx_check_result(), refda_edd_prod_check_result(), refda_eval_oper(), refda_eval_target(), refda_exec_proc_ctrl_finish(), refda_exec_proc_ctrl_start(), refda_exec_proc_expand(), refda_exec_worker_iteration(), refda_oper_eval_ctx_populate(), refda_reporting_gen(), refda_reporting_rptt_val(), refda_reporting_target(), refda_valprod_const_run(), refda_valprod_edd_run(), refda_valprod_run(), refda_valprod_var_run(), refdm_db_insert_execset(), refdm_db_insert_rptset(), refdm_ingress_worker(), and stdin_recv().
| 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. |
References least_severity.
Referenced by LLVMFuzzerInitialize(), and main().
| void cace_openlog | ( | void | ) |
Opens the event log.
This is a mimic to POSIX openlog()
References BSL_LOG_QUEUE_SIZE, cace_log_event_deinit(), cace_log_event_init(), event_queue, cace_log_event_t::message, cace_log_event_t::severity, thr_sink, thr_valid, work_sink(), and write_log().
Referenced by LLVMFuzzerInitialize(), main(), and suiteSetUp().