From 341b6e0704daf460d823c66ee83d441c26084a94 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 Feb 2021 16:11:49 +0100 Subject: all: change G_LOG_DOMAIN to "nm" glib requires G_LOG_DOMAIN defined so that log messages are labeled to belong to NetworkManager or libnm. However, we don't actually want to use glib logging. Our library libnm MUST not log anything, because it spams the user's stdout/stderr. Instead, a library must report notable events via its API. Note that there is also LIBNM_CLIENT_DEBUG to explicitly enable debug logging, but that doesn't use glib logging either. Also, the daemon does not use glib logging instead it logs to syslog. When run with `--debug`. Hence, it's not useful for us to define different G_LOG_DOMAIN per library/application, because none of our libraries/applications should use glib logging. It also gets slightly confusing, because we have the static library like `src/libnm-core-impl`, which is both linked into `libnm` (the library) and `NetworkManager` (the daemon). Which logging domain should they use? Set the G_LOG_DOMAIN to "nm" everywhere. But no longer do it via `-D` arguments to the compiler. See-also: https://developer.gnome.org/glib/stable/glib-Message-Logging.html#G-LOG-DOMAIN:CAPS --- shared/nm-utils/nm-test-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shared/nm-utils/nm-test-utils.h') diff --git a/shared/nm-utils/nm-test-utils.h b/shared/nm-utils/nm-test-utils.h index d51f972ed4..cf884f9c41 100644 --- a/shared/nm-utils/nm-test-utils.h +++ b/shared/nm-utils/nm-test-utils.h @@ -733,7 +733,7 @@ nmtst_test_quick(void) #define NMTST_EXPECT(domain, level, msg) g_test_expect_message(domain, level, msg) -#define NMTST_EXPECT_LIBNM(level, msg) NMTST_EXPECT("libnm", level, msg) +#define NMTST_EXPECT_LIBNM(level, msg) NMTST_EXPECT("nm", level, msg) #define NMTST_EXPECT_LIBNM_WARNING(msg) NMTST_EXPECT_LIBNM(G_LOG_LEVEL_WARNING, msg) #define NMTST_EXPECT_LIBNM_CRITICAL(msg) NMTST_EXPECT_LIBNM(G_LOG_LEVEL_CRITICAL, msg) -- cgit v1.2.1