From c1b57a2c7294297739019685432004f5db678881 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 18 Jan 2023 09:33:28 +0100 Subject: [PATCH] glib-aux/tests: enable TRACE logging level when debugging nmtst tests By setting "NMTST_DEBUG" to any non-empty string, "is_debug" is enabled. So "NMTST_DEBUG='debug,...'" is mostly redundant. Note however you can still disable debug mode explicitly, like "NMTST_DEBUG=no-debug,...", which can make sense if you want to set other flags but not enabling debug mode (like "NMTST_DEBUG=no-debug,quick"). You can also explicitly set the log level ("NMTST_DEBUG='log-level=TRACE,...'" or enable trace debugging with "NMTST_DEBUG='d,...'", where "d" (or "D") is shorthand for "NMTST_DEBUG=log-level=TRACE,no-expect-message,...". Anyway. If you explicitly set the log level with "log-level=" or "d", debug logging is enabled with the "debug" flag. But it only logged at level "". That seems not best. Instead, enable "" level by default in debug mode. That's useful, because there is not a clear distinction between "" and "" level. When debugging, you really want all the information you got, you can also filter out later (`grep` is a thing). --- src/libnm-glib-aux/nm-test-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnm-glib-aux/nm-test-utils.h b/src/libnm-glib-aux/nm-test-utils.h index 48ead7e75b..50280d92b4 100644 --- a/src/libnm-glib-aux/nm-test-utils.h +++ b/src/libnm-glib-aux/nm-test-utils.h @@ -652,7 +652,7 @@ __nmtst_init(int *argc, if (!log_level && log_domains) { /* if the log level is not specified (but the domain is), we assume * the caller wants to set it depending on is_debug */ - log_level = is_debug ? "DEBUG" : "WARN"; + log_level = is_debug ? "TRACE" : "WARN"; } if (!__nmtst_internal.assert_logging) {