improve debug statements a bit

This commit is contained in:
George Kiagiadakis 2019-05-26 12:36:20 +03:00
parent d91a7666b4
commit bf60614032
5 changed files with 18 additions and 10 deletions

View file

@ -259,6 +259,10 @@ wp_endpoint_register (WpEndpoint * self, WpSessionManager * sm)
g_return_if_fail (WP_IS_SESSION_MANAGER (sm));
priv = wp_endpoint_get_instance_private (self);
g_info ("WpEndpoint:%p registering '%s' (%s)", self, priv->name,
priv->media_class);
g_weak_ref_set (&priv->sm, sm);
wp_session_manager_add_endpoint (sm, self);
}
@ -281,6 +285,9 @@ wp_endpoint_unregister (WpEndpoint * self)
priv = wp_endpoint_get_instance_private (self);
sm = g_weak_ref_get (&priv->sm);
if (sm) {
g_info ("WpEndpoint:%p unregistering '%s' (%s)", self, priv->name,
priv->media_class);
g_weak_ref_set (&priv->sm, NULL);
wp_session_manager_remove_endpoint (sm, self);
}

View file

@ -30,6 +30,8 @@ wp_factory_finalize (GObject * obj)
{
WpFactory * self = WP_FACTORY (obj);
g_debug ("WpFactory:%p destroying factory: %s", self, self->name);
g_weak_ref_clear (&self->core);
g_free (self->name);
@ -57,6 +59,8 @@ wp_factory_new (WpCore * core, const gchar * name, WpFactoryFunc func)
f->name_quark = g_quark_from_string (f->name);
f->create_object = func;
g_info ("WpFactory:%p new factory: %s", f, name);
if (!wp_core_register_global (core, f->name_quark, f, g_object_unref))
return NULL;
@ -84,6 +88,8 @@ wp_factory_get_core (WpFactory * self)
gpointer
wp_factory_create_object (WpFactory * self, GType type, GVariant * properties)
{
g_debug ("WpFactory:%p (%s) create object of type %s", self, self->name,
g_type_name (type));
return self->create_object (self, type, properties);
}

View file

@ -36,6 +36,8 @@ wp_module_finalize (GObject * object)
{
WpModule *self = WP_MODULE (object);
g_debug ("WpModule:%p unloading module", self);
if (self->destroy)
self->destroy (self->destroy_data);
g_clear_pointer (&self->properties, g_variant_unref);
@ -112,6 +114,8 @@ wp_module_load (WpCore * core, const gchar * abi,
module = g_object_new (WP_TYPE_MODULE, NULL);
g_weak_ref_init (&module->core, core);
g_info ("WpModule:%p loading module %s (ABI: %s)", module, module_name, abi);
if (!g_strcmp0 (abi, "C")) {
if (!wp_module_load_c (module, core, module_name, args, error))
return NULL;

View file

@ -143,8 +143,6 @@ module_destroy (gpointer d)
{
struct module_data *data = d;
g_debug ("module-pipewire destroy");
pw_remote_destroy (data->remote);
pw_core_destroy (data->core);
g_slice_free (struct module_data, data);
@ -156,8 +154,6 @@ wireplumber__module_init (WpModule * module, WpCore * core, GVariant * args)
GSource *source;
struct module_data *data;
g_debug ("module-pipewire init");
pw_init (NULL, NULL);
data = g_slice_new0 (struct module_data);

View file

@ -14,8 +14,6 @@
#include <wp/wp.h>
#include <pipewire/pipewire.h>
#define NAME "module-pw-alsa-udev"
struct impl {
WpCore *wp_core;
@ -39,7 +37,7 @@ handle_node(struct impl *impl, uint32_t id, uint32_t parent_id,
/* Make sure the node has properties */
if (!props) {
g_warning(NAME" %p: node has no properties, skipping...", impl);
g_warning("node has no properties, skipping...");
return;
}
@ -127,9 +125,6 @@ static void
module_destroy (gpointer data)
{
struct impl *impl = data;
g_debug ("module-pipewire destroy");
g_slice_free (struct impl, impl);
}