forked from osmocom/wireshark
wslog: Print to stderr with a null error handler
For some programs (e.g: unit tests) we want to init the logging subsystem but having to pass an error output handler is overkill and annoying. In that case with a NULL handler printing to stderr by default is almost certainly the best thing to do.
This commit is contained in:
parent
32befe119d
commit
ad66a854a0
|
@ -323,11 +323,11 @@ static void print_err(void (*vcmdarg_err)(const char *, va_list ap),
|
|||
{
|
||||
va_list ap;
|
||||
|
||||
if (vcmdarg_err == NULL)
|
||||
return;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vcmdarg_err(fmt, ap);
|
||||
if (vcmdarg_err)
|
||||
vcmdarg_err(fmt, ap);
|
||||
else
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
if (exit_failure != LOG_ARGS_NOEXIT)
|
||||
exit(exit_failure);
|
||||
|
|
Loading…
Reference in New Issue