From: Zbigniew Jędrzejewski-Szmek Date: Thu, 12 Dec 2013 01:34:19 +0000 (-0500) Subject: Do not log all assert_return failures X-Git-Tag: v209~1006 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=50f72bca65ad291685e5b79903cb6ac3fbc8364d Do not log all assert_return failures % build/journalctl help Assertion 'match_is_valid(data, size)' failed at ../src/journal/sd-journal.c:227, function sd_journal_add_match(). Ignoring. Callers cannot be expect to check all arguments always. --- diff --git a/src/shared/log.c b/src/shared/log.c index 2531e0da0..c654b8622 100644 --- a/src/shared/log.c +++ b/src/shared/log.c @@ -690,6 +690,9 @@ int log_meta_object( static void log_assert(int level, const char *text, const char *file, int line, const char *func, const char *format) { static char buffer[LINE_MAX]; + if (_likely_(LOG_PRI(level) > log_max_level)) + return; + snprintf(buffer, sizeof(buffer), format, text, file, line, func); char_array_0(buffer);