tree-wide: add DEBUG_LOGGING macro that checks whether debug logging is on (#7645)

This makes things a bit easier to read I think, and also makes sure we
always use the _unlikely_ wrapper around it, which so far we used
sometimes and other times we didn't. Let's clean that up.
This commit is contained in:
Lennart Poettering
2017-12-15 11:09:00 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 42521cd1ed
commit f1d34068ef
13 changed files with 21 additions and 11 deletions
+1 -1
View File
@@ -1392,7 +1392,7 @@ int show_journal_by_unit(
if (r < 0)
return log_error_errno(r, "Failed to add unit matches: %m");
if (_unlikely_(log_get_max_level() >= LOG_DEBUG)) {
if (DEBUG_LOGGING) {
_cleanup_free_ char *filter;
filter = journal_make_match_string(j);
+1 -1
View File
@@ -954,7 +954,7 @@ int seccomp_restrict_namespaces(unsigned long retain) {
uint32_t arch;
int r;
if (log_get_max_level() >= LOG_DEBUG) {
if (DEBUG_LOGGING) {
_cleanup_free_ char *s = NULL;
(void) namespace_flag_to_string_many(retain, &s);