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 "<debug>". That seems not best. Instead, enable "<trace>" level by
default in debug mode.

That's useful, because there is not a clear distinction between
"<debug>" and "<trace>" level. When debugging, you really want all the
information you got, you can also filter out later (`grep` is a thing).
This commit is contained in:
Thomas Haller
2023-01-18 09:33:28 +01:00
parent e435c1b07f
commit c1b57a2c72

View File

@@ -652,7 +652,7 @@ __nmtst_init(int *argc,
if (!log_level && log_domains) { if (!log_level && log_domains) {
/* if the log level is not specified (but the domain is), we assume /* if the log level is not specified (but the domain is), we assume
* the caller wants to set it depending on is_debug */ * 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) { if (!__nmtst_internal.assert_logging) {