el_set_log_level

NAME

el_set_log_level - set new log level

SYNOPSIS

#include <embedlog.h>

int el_set_log_level(enum el_level level);

int el_oset_log_level(struct el *el, enum el_level level);

DESCRIPTION

Set what the current logging level shall be. Altough it accepts enum el_level type, this can be whatever number from range <0, 7>. The higher the level, the lower priority of the message. All messages that have lower priority (higher number) then currently set level will not be printed. There are 8 predefined levels, sorted by priority (highest first):

EL_FATAL
EL_ALERT
EL_CRIT
EL_ERROR
EL_WARN
EL_NOTICE
EL_INFO
EL_DBG

EXAMPLES

/* print only alert and fatal logs */
el_set_log_level(EL_ALERT);
/* print only error, critical, alert and fatal */
el_set_log_level(EL_ERROR);
/* print all, including debug logs */
el_set_log_level(EL_DBG);

RETURN VALUE

0 on succes, or -1 and set errno on failure.

ERRORS

ERRORS
EINVAL

specified level is invalid (bigger than EL_DBG).