el_print_extra_info¶
NAME¶
el_print_extra_info - prepends usefull debugging info at beginning of log line.
SYNOPSIS¶
#include <embedlog.h>
int el_print_extra_info(int print);
int el_oprint_extra_info(struct el *el, int print);
DESCRIPTION¶
If set to 1, this will enable EL_FINFO, EL_FUNCINFO and EL_PRINT_LEVEL.
EL_FINFO adds information about log location to each message in format [some_file.c:123]. Setting this to 0, will result in no file information at all
EL_FUNCINFO adds information about function from which message has been printed in format [funcname()] or if EL_FINFO is enabled [some_file.c:123:funcname()]. Setting this to 0 will result in no function information.
If EL_PRINT_LEVEL is set each log will have log level information prefix in format "l/" where 'l' is first character of level message is printed with.
EXAMPLES¶
el_print_extra_info(0);
el_print(ELI, "some lonely log");
/* log output */
/* some lonely log */
el_print_extra_info(1);
el_print(ELI, "some happy log");
/* log output */
/* [source-file.c:73:function()] i/some happy log
RETURN VALUE¶
0 on succes, or -1 and set errno on failure.