Contiki-NG
Functions
Per-module, per-level logging

The log module performs per-module, per-level logging. More...

Functions

void log_6addr (const uip_ipaddr_t *ipaddr)
 Logs an IPv6 address. More...
 
void log_6addr_compact (const uip_ipaddr_t *ipaddr)
 Logs an IPv6 address with a compact format. More...
 
void log_lladdr (const linkaddr_t *lladdr)
 Logs a link-layer address. More...
 
void log_lladdr_compact (const linkaddr_t *lladdr)
 Logs a link-layer address with a compact format. More...
 
void log_set_level (const char *module, int level)
 Sets a log level at run-time. More...
 
int log_get_level (const char *module)
 Returns the current log level. More...
 
const char * log_level_to_str (int level)
 Returns a textual description of a log level. More...
 

Detailed Description

The log module performs per-module, per-level logging.

Function Documentation

void log_6addr ( const uip_ipaddr_t *  ipaddr)

Logs an IPv6 address.

Parameters
ipaddrThe IPv6 address

Definition at line 86 of file log.c.

References uiplib_ipaddr_snprint().

Referenced by coap_endpoint_log().

void log_6addr_compact ( const uip_ipaddr_t *  ipaddr)

Logs an IPv6 address with a compact format.

Parameters
ipaddrThe IPv6 address

Definition at line 94 of file log.c.

References UIP_HTONS, uip_is_addr_linklocal, and uip_is_addr_mcast.

int log_get_level ( const char *  module)

Returns the current log level.

Parameters
moduleThe target module string descriptor
Returns
The current log level

Definition at line 157 of file log.c.

const char * log_level_to_str ( int  level)

Returns a textual description of a log level.

Parameters
levellog level
Returns
The textual description

Definition at line 173 of file log.c.

void log_lladdr ( const linkaddr_t *  lladdr)

Logs a link-layer address.

Parameters
lladdrThe link-layer address

Definition at line 111 of file log.c.

void log_lladdr_compact ( const linkaddr_t *  lladdr)

Logs a link-layer address with a compact format.

Parameters
lladdrThe link-layer address

Definition at line 128 of file log.c.

References linkaddr_cmp(), linkaddr_null, and UIP_HTONS.

void log_set_level ( const char *  module,
int  level 
)

Sets a log level at run-time.

Logs are included in the firmware via the compile-time flags in log-conf.h, but this allows to force lower log levels, system-wide.

Parameters
moduleThe target module string descriptor
levelThe log level

Definition at line 142 of file log.c.