From ebf5c9e79fd93d7685fa4a6b436faee87a90e699 Mon Sep 17 00:00:00 2001 From: Maciej Slodczyk Date: Thu, 10 Jan 2019 14:21:45 +0100 Subject: [PATCH] util: allow filterspec to work with empty-tagged messages Change-Id: I9b49e3a07145e2f3dc83ab59b99e9ee340dab414 Signed-off-by: Maciej Slodczyk --- src/shared/logprint.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/logprint.c b/src/shared/logprint.c index 59cc446..72dc33c 100644 --- a/src/shared/logprint.c +++ b/src/shared/logprint.c @@ -228,6 +228,10 @@ bool log_should_print_line(log_format *p_format, const struct logger_entry *entr log_priority prio; tag = log_buffer_get_tag(entry); + /* mark empty-tagged messages and make it easy to catch an application that does that */ + if (!tag || !strlen(tag)) + tag = "DLOG_ERROR_NOTAG"; + prio = (log_priority)entry->priority; for (p_curFilter = p_format->filters; p_curFilter != NULL; p_curFilter = p_curFilter->p_next) { -- 2.7.4