Logging
File: es_log.h
Description: ES Client lib logging utility. To use this module it is required to ‘attach’ it to a configured UART interface. The tx handler of the log_iface should be assigned to a functional UART transmit handler.
Example Usage
1uint32_t baudrate = 115200;
2
3es_log_iface_t log_iface = es_log_iface_init_default;
4es_uart_dbg_drv_init(baudrate); // Target specific UART init function
5log_iface.timestamp = es_system_get_tick; // Target specific get tick handler
6log_iface.drv_iface.tx = es_uart_dbg_drv_tx; // Target specific UART transmit handler
7es_log_init(&log_iface);
8es_log_set_lvl(ES_INFO);
9ES_LOG_MSG(ES_INFO, "Logging Initialized");
Log Levels
-
enumerator es_log_lvl_t
[source] ES log levels
-
enumerator ES_CRITICAL
[source] One or more key business functionalities are not working and the whole system doesn’t fulfill the business functionalities.
-
enumerator ES_DEBUG
[source] A log level used for events considered to be useful during software debugging when more granular information is needed.
-
enumerator ES_ERROR
[source] One or more functionalities are not working, preventing some functionalities from working correctly.
-
enumerator ES_INFO
[source] An event happened, the event is purely informative and can be ignored during normal operations.
-
enumerator ES_CRITICAL
MACROS
Interface
Interface Functions
-
void es_log_init(es_log_iface_t *log_iface)
[source] Initialize es log interface.
- Parameters:
log_iface: – Reference to intialized es_log_iface_t structure
-
void es_log_set_lvl(es_log_lvl_t level)
[source] Set log level
- Parameters:
level: – Log level
-
es_log_lvl_t es_log_get_lvl(void)
[source] Get the current log level
Will be deprecated
- Returns:
Returns the current log level