gdebugcontroller: Add debug controller API and D-Bus implementation

This is intended to provide a uniform interface for controlling whether
the debug output from an application (or service) is emitted, typically
to journald, but actually to wherever the application chooses to output
it.

The main implementation of `GDebugController` is `GDebugControllerDBus`,
which is intended to be used on Linux. Other implementations may be
added in future for other platforms, or larger applications may want to
provide their own implementation which integrates with their ecosystem.

The `GDebugControllerDBus` implementation exposes a D-Bus interface at
`/org/gtk/Debugging` with a method to enable or disable debug
output at runtime.

This could be used by external harnesses, such as GNOME Builder or
systemd, to give a uniform way to get debug output from an application.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #1190
This commit is contained in:
Philip Withnall
2021-11-11 10:56:50 +00:00
parent bb4bec0921
commit 0c8f7de55a
10 changed files with 815 additions and 0 deletions

View File

@@ -4205,6 +4205,36 @@ G_DBUS_OBJECT_MANAGER_SERVER_GET_CLASS
GDBusObjectManagerServerPrivate
</SECTION>
<SECTION>
<FILE>gdebugcontroller</FILE>
<TITLE>GDebugController</TITLE>
GDebugController
GDebugControllerInterface
G_DEBUG_CONTROLLER_EXTENSION_POINT_NAME
g_debug_controller_dup_default
g_debug_controller_get_debug_enabled
g_debug_controller_set_debug_enabled
<SUBSECTION Standard>
g_debug_controller_get_type
G_TYPE_DEBUG_CONTROLLER
G_DEBUG_CONTROLLER
G_IS_DEBUG_CONTROLLER
G_DEBUG_CONTROLLER_GET_INTERFACE
</SECTION>
<SECTION>
<FILE>gdebugcontrollerdbus</FILE>
<TITLE>GDebugControllerDBus</TITLE>
GDebugControllerDBus
g_debug_controller_dbus_new
<SUBSECTION Standard>
g_debug_controller_dbus_get_type
G_TYPE_DEBUG_CONTROLLER_DBUS
G_DEBUG_CONTROLLER_DBUS
G_IS_DEBUG_CONTROLLER_DBUS
G_DEBUG_CONTROLLER_DBUS_GET_CLASS
</SECTION>
<SECTION>
<FILE>gmemorymonitor</FILE>
<TITLE>GMemoryMonitor</TITLE>