event-log.c (dovecot-2.3.16) | : | event-log.c (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 258 | skipping to change at line 258 | |||
va_end(args); | va_end(args); | |||
} | } | |||
#undef event_want_log_level | #undef event_want_log_level | |||
bool event_want_log_level(struct event *event, enum log_type level, | bool event_want_log_level(struct event *event, enum log_type level, | |||
const char *source_filename, | const char *source_filename, | |||
unsigned int source_linenum) | unsigned int source_linenum) | |||
{ | { | |||
struct failure_context ctx = { .type = LOG_TYPE_DEBUG }; | struct failure_context ctx = { .type = LOG_TYPE_DEBUG }; | |||
if (event->min_log_level <= level) | if (level >= event->min_log_level) { | |||
/* Always log when level is at least this high */ | ||||
return TRUE; | return TRUE; | |||
} | ||||
if (event->debug_level_checked_filter_counter == event_filter_replace_cou | if (event->debug_level_checked_filter_counter == event_filter_replace_cou | |||
nter) | nter) { | |||
/* Log filters haven't changed since we last checked this, so | ||||
we can rely on the last cached value. FIXME: this doesn't | ||||
work correctly if event changes and the change affects | ||||
whether the filters would match. */ | ||||
return event->sending_debug_log; | return event->sending_debug_log; | |||
} | ||||
event->debug_level_checked_filter_counter = | event->debug_level_checked_filter_counter = | |||
event_filter_replace_counter; | event_filter_replace_counter; | |||
if (event->forced_debug) | if (event->forced_debug) { | |||
/* Debugging is forced for this event (and its children) */ | ||||
event->sending_debug_log = TRUE; | event->sending_debug_log = TRUE; | |||
} else if (global_debug_log_filter != NULL && | ||||
else if (global_debug_log_filter != NULL && | event_filter_match_source(global_debug_log_filter, event, | |||
event_filter_match_source(global_debug_log_filter, event, | source_filename, source_linenum, &ct | |||
source_filename, source_linenum, &ctx) | x)) { | |||
) | /* log_debug filter matched */ | |||
event->sending_debug_log = TRUE; | event->sending_debug_log = TRUE; | |||
else if (global_core_log_filter != NULL && | } else if (global_core_log_filter != NULL && | |||
event_filter_match_source(global_core_log_filter, event, | event_filter_match_source(global_core_log_filter, event, | |||
source_filename, source_linenum, &ctx) | source_filename, source_linenum, &ct | |||
) | x)) { | |||
/* log_core_filter matched */ | ||||
event->sending_debug_log = TRUE; | event->sending_debug_log = TRUE; | |||
else | } else { | |||
event->sending_debug_log = FALSE; | event->sending_debug_log = FALSE; | |||
} | ||||
return event->sending_debug_log; | return event->sending_debug_log; | |||
} | } | |||
#undef event_want_level | #undef event_want_level | |||
bool event_want_level(struct event *event, enum log_type level, | bool event_want_level(struct event *event, enum log_type level, | |||
const char *source_filename, | const char *source_filename, | |||
unsigned int source_linenum) | unsigned int source_linenum) | |||
{ | { | |||
(void)event_want_log_level(event, level, source_filename, source_linenum) | if (event_want_log_level(event, level, source_filename, source_linenum)) | |||
; | ||||
if (event->sending_debug_log) | ||||
return TRUE; | ||||
if (event->min_log_level <= level) | ||||
return TRUE; | return TRUE; | |||
/* see if debug send filtering matches */ | /* see if debug send filtering matches */ | |||
if (global_debug_send_filter != NULL) { | if (global_debug_send_filter != NULL) { | |||
struct failure_context ctx = { .type = LOG_TYPE_DEBUG }; | struct failure_context ctx = { .type = LOG_TYPE_DEBUG }; | |||
if (event_filter_match_source(global_debug_send_filter, event, | if (event_filter_match_source(global_debug_send_filter, event, | |||
source_filename, source_linenum, | source_filename, source_linenum, | |||
&ctx)) | &ctx)) | |||
return TRUE; | return TRUE; | |||
End of changes. 10 change blocks. | ||||
20 lines changed or deleted | 25 lines changed or added |