mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-12-04 14:46:31 -05:00
Feature: Print logmsg options
This commit is contained in:
parent
de2712ab48
commit
74d5a02530
@ -141,16 +141,22 @@ static igloo_filter_result_t __handle(igloo_INTERFACE_BASIC_ARGS, igloo_ro_t obj
|
|||||||
time_t now;
|
time_t now;
|
||||||
char pre[256+LOG_MAXLINELEN];
|
char pre[256+LOG_MAXLINELEN];
|
||||||
int datelen;
|
int datelen;
|
||||||
|
char flags[3] = " ";
|
||||||
|
|
||||||
if (!msg)
|
if (!msg)
|
||||||
return igloo_FILTER_RESULT_DROP;
|
return igloo_FILTER_RESULT_DROP;
|
||||||
|
|
||||||
|
if (msg->options & igloo_LOGMSG_OPT_DEVEL)
|
||||||
|
flags[0] = 'D';
|
||||||
|
|
||||||
|
if (msg->options & igloo_LOGMSG_OPT_ASKACK)
|
||||||
|
flags[1] = 'A';
|
||||||
|
|
||||||
level = __level2str(msg->level);
|
level = __level2str(msg->level);
|
||||||
|
|
||||||
now = msg->ts.tv_sec;
|
now = msg->ts.tv_sec;
|
||||||
datelen = strftime(pre, sizeof(pre), "[%Y-%m-%d %H:%M:%S]", localtime(&now));
|
datelen = strftime(pre, sizeof(pre), "[%Y-%m-%d %H:%M:%S]", localtime(&now));
|
||||||
snprintf(pre+datelen, sizeof(pre)-datelen, " %s %s/%s(%s:%zi) %s\n", level, msg->cat, msg->func, msg->codefile, msg->codeline, msg->string);
|
snprintf(pre+datelen, sizeof(pre)-datelen, " %s [%s] %s/%s(%s:%zi) %s\n", level, flags, msg->cat, msg->func, msg->codefile, msg->codeline, msg->string);
|
||||||
igloo_io_write(igloo_RO_TO_TYPE(*backend_object, igloo_io_t), pre, strlen(pre));
|
igloo_io_write(igloo_RO_TO_TYPE(*backend_object, igloo_io_t), pre, strlen(pre));
|
||||||
|
|
||||||
return igloo_FILTER_RESULT_PASS;
|
return igloo_FILTER_RESULT_PASS;
|
||||||
|
Loading…
Reference in New Issue
Block a user