mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 17:00:14 +01:00
libnm: with LIBNM_CLIENT_DEBUG logging always print to default destination
With enabled assertions via LIBNM_CLIENT_DEBUG=WARN or LIBNM_CLIENT_DEBUG=ERROR, still print the warning/error message to the default destination, along the trace/debug messages. For example, when you set LIBNM_CLIENT_DEBUG_FILE, then we want that those messages end up in the file too, not only in g_log() output. Also, g_warning() prints to stderr. If you set LIBNM_CLIENT_DEBUG="WARN,trace,stdout", then we printed the warning to stderr and the trace messages to stdout. All debug messages should and up at the same place, and the g_warning() and g_critical() messages are additional. Also because glib's g_log() supports its own redirection and suppression mechanism.
This commit is contained in:
parent
5c08fa2776
commit
15d17febeb
1 changed files with 2 additions and 6 deletions
|
|
@ -177,17 +177,13 @@ _nml_dbus_log(NMLDBusLogLevel level, gboolean use_stdout, const char *fmt, ...)
|
|||
break;
|
||||
case NML_DBUS_LOG_LEVEL_WARN:
|
||||
prefix = "<warn > ";
|
||||
if (NM_FLAGS_HAS(configured_log_level, NML_DBUS_LOG_ASSERT)) {
|
||||
if (NM_FLAGS_HAS(configured_log_level, NML_DBUS_LOG_ASSERT))
|
||||
g_warning("libnm-dbus: %s%s", prefix, msg);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case NML_DBUS_LOG_LEVEL_ERROR:
|
||||
prefix = "<error> ";
|
||||
if (NM_FLAGS_HAS(configured_log_level, NML_DBUS_LOG_ASSERT)) {
|
||||
if (NM_FLAGS_HAS(configured_log_level, NML_DBUS_LOG_ASSERT))
|
||||
g_critical("libnm-dbus: %s%s", prefix, msg);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue