Contiki 2.5
Files | Functions
Logging subsystem

The logging subsystem allows different logdomains to be configured. More...

Files

file  logging.c
 
    Implementation of the logging subsystem

 
file  logging.h
 
    Header file for the logging subsystem

 

Functions

const char * logging_dom2str (uint8_t logdom)
 Convert the log domain symbol to a string. More...
 
const char * logging_level2str (uint8_t logl)
 Convert the log level symbol to a string. More...
 
void logging_init (void)
 Initialize the logging subsystem. More...
 
void logging_domain_level_set (uint8_t logdom, uint8_t sdom, uint8_t logl)
 Set the verbosity of the logging domain. More...
 
void logging_logfn (uint8_t logdom, uint8_t sdom, uint8_t logl, const char *fmt,...)
 Log a message. More...
 

Detailed Description

The logging subsystem allows different logdomains to be configured.

For each of these logdomains the verbosity of the output can be set during runtime.

Function Documentation

const char * logging_dom2str ( uint8_t  logdom)

Convert the log domain symbol to a string.

Parameters
logdomthe log domain
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
logdomthe domain for which to set the verbosity
sdomthe subdomain
loglthe 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
loglthe log level
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
logdomthe logdomain of the message
sdomthe subdomain
loglthe loglevel of the mesage
fmtthe 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.