diff options
author | Thomas Haller <thaller@redhat.com> | 2021-02-17 16:11:49 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-02-18 19:46:57 +0100 |
commit | 341b6e0704daf460d823c66ee83d441c26084a94 (patch) | |
tree | 4d2ad9c23a5c948d558100058720bef7ecdd14d4 /libnm | |
parent | 243051a8a62a01dc34a89cf9b3ea4d3ad961805b (diff) | |
download | NetworkManager-th/libnm-core-split.tar.gz |
all: change G_LOG_DOMAIN to "nm"th/libnm-core-split
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
Diffstat (limited to 'libnm')
-rw-r--r-- | libnm/meson.build | 7 | ||||
-rw-r--r-- | libnm/nm-enum-types.c.template | 4 | ||||
-rw-r--r-- | libnm/tests/meson.build | 6 |
3 files changed, 1 insertions, 16 deletions
diff --git a/libnm/meson.build b/libnm/meson.build index 8462d4bc50..8c07663cbb 100644 --- a/libnm/meson.build +++ b/libnm/meson.build @@ -147,9 +147,6 @@ libnm_static = static_library( libnm_udev_aux_dep, libudev_dep, ], - c_args: [ - '-DG_LOG_DOMAIN="libnm"', - ], link_with: libnm_systemd_logging_stub, ) @@ -214,7 +211,6 @@ if enable_introspection header: 'NetworkManager.h', export_packages: libnm_name, extra_args: [ - '-DG_LOG_DOMAIN="libnm"', '-DNETWORKMANAGER_COMPILATION', ], install: true, @@ -307,9 +303,6 @@ libnm_libnm_aux = static_library( sources: files( 'nm-libnm-aux/nm-libnm-aux.c', ), - c_args: [ - '-DG_LOG_DOMAIN="libnmc"', - ], dependencies: [ libnm_core_aux_intern_dep, libnm_dep, diff --git a/libnm/nm-enum-types.c.template b/libnm/nm-enum-types.c.template index ccad218c07..396f61526c 100644 --- a/libnm/nm-enum-types.c.template +++ b/libnm/nm-enum-types.c.template @@ -1,9 +1,7 @@ /*** BEGIN file-header ***/ -#include "config.h" +#include "libnm/nm-default-libnm.h" #include "nm-enum-types.h" -# -#include "libnm/nm-default-libnm.h" #include "nm-version-macros.h" #include "NetworkManager.h" diff --git a/libnm/tests/meson.build b/libnm/tests/meson.build index efc86a71b3..d2e5fe7ef6 100644 --- a/libnm/tests/meson.build +++ b/libnm/tests/meson.build @@ -19,9 +19,6 @@ foreach test_unit: test_units libnm_core_impl_dep_link, libnm_nm_default_dep, ], - c_args: [ - '-DG_LOG_DOMAIN="test"', - ], link_with: [ libnm_static, libnm_base, @@ -42,7 +39,4 @@ libnm_vpn_plugin_utils_test = static_library( sources: nm_vpn_plugin_utils_source + [libnm_enum_sources[1]], include_directories: libnm_inc, dependencies: libnm_nm_default_dep, - c_args: [ - '-DG_LOG_DOMAIN="test"', - ], ) |