NetworkManager/libnm
Thomas Haller a5b2ba02ea libnm: add logging NML_DBUS_LOG*() for debugging D-Bus for NMClient
Commonly, a library (like libnm) is not supposed to log anything.
Logging is not a suitable way to notify the calling application
about anything. When something of importance happens, then the
application must be notified via the library's API.

However, logging can be very useful for debugging to see what is going
on. Add a logging macro that by default does nothing, but can be turned
on via an environment variable "LIBNM_CLIENT_DEBUG=debug".

Another point is that libnm relies on the server side NetworkManager
D-Bus interface to be in an expected manner. For example, we require a
D-Bus object "org.freedesktop.NetworkManager" to be present and certain
D-Bus interfaces implemented.

However libnm should treat NetworkManager as external and untrusted component.
That means, we cannot assert against the expectations we have. There are two
reasons for this:

  - a bug in NetworkManager, dbus-daemon or else may cause such errors.
    This must not trigger an assertion failure in the client
    application, at least not unless requested.

  - libnm must be forward and backward compatible against a different
    NetworkManager server version. That is only possibly by ignoring
    anything that is unexpected. Asserting by default might prevent
    to implement API changes, both on libnm and server side.

Note that we also don't notify the calling application via dedicated
API. On the one hand, these things *can* happen. On the other hand, what
would the calling appication do about it anyway? libnm by default must
just behave gracefully and pretend all is good.

For testing, development and debugging that is however not useful. We
want the user to opt in to strict API validation. The user will be able
to do that by setting "LIBNM_CLIENT_DEBUG=warning", which causes API
violations being logged with g_warning(). These are assertions when
running with G_DEBUG=fatal-warnings.

This is inspired by GDBus' G_DBUS_DEBUG variable.

Note that LIBNM_CLIENT_DEBUG environment variables is undocumented, unstable
API. It's used for debugging and testing of the current libnm version at hand.
There is no guaranteed stable behavior how a different libnm version
might behave.
2019-10-18 22:09:18 +02:00
..
tests libnm/tests: add test for checking types 2019-10-18 22:09:18 +02:00
generate-plugin-docs.pl all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
generate-setting-docs.py all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
libnm.pc.in libnm,pkg-config: provide a variable with VPN service directory 2015-08-19 15:13:11 +02:00
libnm.ver libnm: add NM_CLIENT_DBUS_NAME_OWNER property 2019-10-18 22:09:18 +02:00
meson.build meson: Ease the use of the libnm-libnm-core-intern library 2019-10-01 09:49:33 +02:00
NetworkManager.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-access-point.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-access-point.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-active-connection.c libnm: avoid g_object_notify() in favor of _notify() 2019-10-18 22:09:18 +02:00
nm-active-connection.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-autoptr.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-checkpoint.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-checkpoint.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-client.c libnm: add NM_CLIENT_DBUS_NAME_OWNER property 2019-10-18 22:09:18 +02:00
nm-client.h libnm: add NM_CLIENT_DBUS_NAME_OWNER property 2019-10-18 22:09:18 +02:00
nm-dbus-helpers.c libnm: rework caching singleton value in _nm_dbus_bus_type() 2019-10-18 22:09:18 +02:00
nm-dbus-helpers.h libnm: add helper functions for refactoring D-Bus calls in libnm 2019-10-16 08:56:00 +02:00
nm-device-6lowpan.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-6lowpan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-adsl.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-adsl.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-bond.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-bond.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-bridge.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-bridge.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-bt.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-bt.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-dummy.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-dummy.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ethernet.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-ethernet.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-generic.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-generic.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-infiniband.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-infiniband.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ip-tunnel.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-ip-tunnel.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-macsec.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-macsec.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-macvlan.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-macvlan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-modem.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-modem.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-olpc-mesh.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-olpc-mesh.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ovs-bridge.c libnm: belatedly add GObject property "NMDeviceOvs{Bridge,Port}:slaves" 2019-10-18 22:09:18 +02:00
nm-device-ovs-bridge.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ovs-interface.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ovs-interface.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ovs-port.c libnm: belatedly add GObject property "NMDeviceOvs{Bridge,Port}:slaves" 2019-10-18 22:09:18 +02:00
nm-device-ovs-port.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ppp.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ppp.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-private.h libnm: use the o.fd.DBus.ObjectManager API for object management 2016-11-10 16:48:48 +01:00
nm-device-team.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-team.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-tun.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-tun.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-vlan.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-vlan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-vxlan.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-vxlan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-wifi-p2p.c libnm: implement nm_device_wifi_p2p_start_find()/nm_device_wifi_p2p_stop_find() by using GDBusConnection directly 2019-10-16 08:56:00 +02:00
nm-device-wifi-p2p.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-wifi.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-wifi.h libnm: deprecate synchronous/blocking API in libnm 2019-10-03 10:39:48 +02:00
nm-device-wimax.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-wimax.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-wireguard.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-wireguard.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-wpan.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device-wpan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-device.h libnm: deprecate synchronous/blocking API in libnm 2019-10-03 10:39:48 +02:00
nm-dhcp-config.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-dhcp-config.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp4-config.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp4-config.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp6-config.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dhcp6-config.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-dns-manager.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-dns-manager.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-enum-types.c.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-enum-types.h.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-ip-config.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-ip-config.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-ip4-config.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-ip4-config.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-ip6-config.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-ip6-config.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-libnm-utils.c libnm: add logging NML_DBUS_LOG*() for debugging D-Bus for NMClient 2019-10-18 22:09:18 +02:00
nm-libnm-utils.h libnm: add logging NML_DBUS_LOG*() for debugging D-Bus for NMClient 2019-10-18 22:09:18 +02:00
nm-manager.c libnm: avoid g_object_notify() in favor of _notify() 2019-10-18 22:09:18 +02:00
nm-manager.h libnm: implement nm_client_reload() by using GDBusConnection directly 2019-10-16 08:56:00 +02:00
nm-object-private.h libnm: add helper functions for refactoring D-Bus calls in libnm 2019-10-16 08:56:00 +02:00
nm-object.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-object.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-remote-connection-private.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-remote-connection.c libnm: avoid g_object_notify() in favor of _notify() 2019-10-18 22:09:18 +02:00
nm-remote-connection.h libnm: deprecate synchronous/blocking API in libnm 2019-10-03 10:39:48 +02:00
nm-remote-settings.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-remote-settings.h libnm: implement nm_client_add_connection*() by using GDBusConnection directly 2019-10-16 08:56:01 +02:00
nm-secret-agent-old.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-secret-agent-old.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-types.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-connection.c libnm: avoid g_object_notify() in favor of _notify() 2019-10-18 22:09:18 +02:00
nm-vpn-connection.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-editor.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-editor.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-plugin-old.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-vpn-plugin-old.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-vpn-service-plugin.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-vpn-service-plugin.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-wifi-p2p-peer.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-wifi-p2p-peer.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-wimax-nsp.c libnm: use obj_properties array in libnm and cleanup 2019-10-18 22:09:18 +02:00
nm-wimax-nsp.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00