The logging subsystem allows different logdomains to be configured.
More...
|
file | logging.c |
| Implementation of the logging subsystem
|
|
file | logging.h |
| Header file for the logging subsystem
|
|
The logging subsystem allows different logdomains to be configured.
For each of these logdomains the verbosity of the output can be set during runtime.
const char * logging_dom2str |
( |
uint8_t |
logdom | ) |
|
Convert the log domain symbol to a string.
- Parameters
-
- Returns
- String of the log domain
- Author
- Daniel Willmann
The function returns a three letter acronym
used in the log messages to identify the
different log domains.
Definition at line 94 of file logging.c.
void logging_domain_level_set |
( |
uint8_t |
logdom, |
|
|
uint8_t |
sdom, |
|
|
uint8_t |
logl |
|
) |
| |
Set the verbosity of the logging domain.
- Parameters
-
logdom | the domain for which to set the verbosity |
sdom | the subdomain |
logl | the minimal severity of the mesages that are logged |
- Author
- Daniel Willmann
This function sets the loglevel above which messages
are logged (printed). Possible values are in order:
* LOGL_DBG - Debug messages. Very verbose output
* LOGL_INF - Informational messages. General information
that might be useful
* LOGL_WRN - Warnings. Abnormal program conditions that
do not impair normal operation of the program
* LOGL_ERR - Errors. The program can recover from these,
but some functionality is impaired
* LOGL_CRI - Critical errors. The program usually cannot
recover from these
Definition at line 167 of file logging.c.
void logging_init |
( |
void |
| ) |
|
Initialize the logging subsystem.
- Author
- Daniel Willmann
This function initializes the logging subsystem and
should be called before any other function from the
module.
Definition at line 130 of file logging.c.
const char * logging_level2str |
( |
uint8_t |
logl | ) |
|
Convert the log level symbol to a string.
- Parameters
-
- Returns
- String of the log level
- Author
- Daniel Willmann
The function returns a three letter acronym
used in the log messages to identify the
different log levels.
Definition at line 113 of file logging.c.
void logging_logfn |
( |
uint8_t |
logdom, |
|
|
uint8_t |
sdom, |
|
|
uint8_t |
logl, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Log a message.
- Parameters
-
logdom | the logdomain of the message |
sdom | the subdomain |
logl | the loglevel of the mesage |
fmt | the format string of the message |
... | any parameters that are needed for the format string |
- Author
- Daniel Willmann
This is the actual logging function that decides whether
the message should be printed or not. Do not use this
function, instead use the LOGGING_LOG macro as this
includes source file and line number inside the message.
Definition at line 191 of file logging.c.