This include common/log.h to source files that are using spice logging functions from spice-common and define some specific subdomains, they are: audio channel cursor display gtk-session input main playback port record session smartcard usb usbredir vmcstream webdav widget With the latest changes on spice-common, one should be able to use domains for better debugging. e.g. All debug info from spice-channel, channel-usbredir but only warning and above for everything else SPICE_DEBUG=*:warning,channel:*,usbredir:* --- src/bio-gio.c | 1 + src/channel-base.c | 1 + src/channel-cursor.c | 8 ++++++++ src/channel-display-mjpeg.c | 2 ++ src/channel-display.c | 9 +++++++++ src/channel-inputs.c | 9 +++++++++ src/channel-main.c | 9 +++++++++ src/channel-playback.c | 9 +++++++++ src/channel-port.c | 9 +++++++++ src/channel-record.c | 9 +++++++++ src/channel-smartcard.c | 9 +++++++++ src/channel-usbredir.c | 9 +++++++++ src/channel-webdav.c | 8 ++++++++ src/coroutine.h | 1 - src/coroutine_gthread.c | 2 ++ src/coroutine_ucontext.c | 2 ++ src/coroutine_winfibers.c | 2 ++ src/decode-glz.c | 2 ++ src/decode-jpeg.c | 2 ++ src/decode-zlib.c | 2 ++ src/desktop-integration.c | 2 ++ src/giopipe.c | 2 ++ src/map-file | 4 ++++ src/smartcard-manager.c | 9 +++++++++ src/spice-audio.c | 9 +++++++++ src/spice-channel.c | 9 +++++++++ src/spice-common.h | 1 - src/spice-gstaudio.c | 8 ++++++++ src/spice-gtk-session.c | 9 +++++++++ src/spice-option.c | 2 ++ src/spice-pulse.c | 8 ++++++++ src/spice-session.c | 9 +++++++++ src/spice-uri.c | 1 + src/spice-util.c | 2 ++ src/spice-util.h | 1 - src/spice-widget.c | 8 ++++++++ src/usb-device-manager.c | 9 +++++++++ src/usb-device-widget.c | 12 +++++++++++- src/usbutil.c | 2 ++ src/vmcstream.c | 8 ++++++++ src/vncdisplaykeymap.c | 2 ++ src/win-usb-dev.c | 9 +++++++++ src/win-usb-driver-install.c | 9 +++++++++ 43 files changed, 236 insertions(+), 4 deletions(-) diff --git a/src/bio-gio.c b/src/bio-gio.c index 04d6613..1b7855c 100644 --- a/src/bio-gio.c +++ b/src/bio-gio.c @@ -22,6 +22,7 @@ #include "spice-util.h" #include "bio-gio.h" +#include "common/log.h" typedef struct bio_gsocket_method { BIO_METHOD method; diff --git a/src/channel-base.c b/src/channel-base.c index 29163dc..3ae983a 100644 --- a/src/channel-base.c +++ b/src/channel-base.c @@ -22,6 +22,7 @@ #include "spice-session-priv.h" #include "spice-channel-priv.h" +#include "common/log.h" /* coroutine context */ G_GNUC_INTERNAL diff --git a/src/channel-cursor.c b/src/channel-cursor.c index b4a8519..e42a89d 100644 --- a/src/channel-cursor.c +++ b/src/channel-cursor.c @@ -24,6 +24,10 @@ #include "spice-channel-priv.h" #include "spice-channel-cache.h" #include "spice-marshal.h" +#include "common/log.h" + +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_cursor); +#define SPICE_LOG_DOMAIN spice_log_domain_cursor /** * SECTION:channel-cursor @@ -95,6 +99,8 @@ static void spice_cursor_channel_finalize(GObject *obj) if (G_OBJECT_CLASS(spice_cursor_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_cursor_channel_parent_class)->finalize(obj); + + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_cursor); } /* coroutine context */ @@ -113,6 +119,8 @@ static void spice_cursor_channel_class_init(SpiceCursorChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_cursor, "cursor"); + gobject_class->finalize = spice_cursor_channel_finalize; channel_class->channel_reset = spice_cursor_channel_reset; diff --git a/src/channel-display-mjpeg.c b/src/channel-display-mjpeg.c index 0c1f2f1..2aa3d8a 100644 --- a/src/channel-display-mjpeg.c +++ b/src/channel-display-mjpeg.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include "spice-client.h" #include "spice-common.h" #include "spice-channel-priv.h" diff --git a/src/channel-display.c b/src/channel-display.c index 3eb7952..621706c 100644 --- a/src/channel-display.c +++ b/src/channel-display.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif @@ -39,6 +41,9 @@ #include "channel-display-priv.h" #include "decode.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_display); +#define SPICE_LOG_DOMAIN spice_log_domain_display + /** * SECTION:channel-display * @short_description: remote display area @@ -146,6 +151,8 @@ static void spice_display_channel_finalize(GObject *object) if (G_OBJECT_CLASS(spice_display_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_display_channel_parent_class)->finalize(object); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_display); } static void spice_display_channel_constructed(GObject *object) @@ -229,6 +236,8 @@ static void spice_display_channel_class_init(SpiceDisplayChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_display, "display"); + gobject_class->finalize = spice_display_channel_finalize; gobject_class->dispose = spice_display_channel_dispose; gobject_class->get_property = spice_display_get_property; diff --git a/src/channel-inputs.c b/src/channel-inputs.c index 94d4d0f..2ec99cb 100644 --- a/src/channel-inputs.c +++ b/src/channel-inputs.c @@ -17,10 +17,15 @@ */ #include "config.h" +#include "common/log.h" + #include "spice-client.h" #include "spice-common.h" #include "spice-channel-priv.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_input); +#define SPICE_LOG_DOMAIN spice_log_domain_input + /** * SECTION:channel-inputs * @short_description: control the server mouse and keyboard @@ -101,6 +106,8 @@ static void spice_inputs_channel_finalize(GObject *obj) { if (G_OBJECT_CLASS(spice_inputs_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_inputs_channel_parent_class)->finalize(obj); + + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_input); } static void spice_inputs_channel_class_init(SpiceInputsChannelClass *klass) @@ -108,6 +115,8 @@ static void spice_inputs_channel_class_init(SpiceInputsChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_input, "input"); + gobject_class->finalize = spice_inputs_channel_finalize; gobject_class->get_property = spice_inputs_get_property; channel_class->channel_up = spice_inputs_channel_up; diff --git a/src/channel-main.c b/src/channel-main.c index 1dd52a6..5dc4ff7 100644 --- a/src/channel-main.c +++ b/src/channel-main.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <math.h> #include <spice/vd_agent.h> #include <common/rect.h> @@ -33,6 +35,9 @@ #include "spice-audio-priv.h" #include "spice-file-transfer-task.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_main); +#define SPICE_LOG_DOMAIN spice_log_domain_main + /** * SECTION:channel-main * @short_description: the main Spice channel @@ -426,6 +431,8 @@ static void spice_main_channel_finalize(GObject *obj) if (G_OBJECT_CLASS(spice_main_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_main_channel_parent_class)->finalize(obj); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_main); } /* coroutine context */ @@ -503,6 +510,8 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_main, "main"); + gobject_class->dispose = spice_main_channel_dispose; gobject_class->finalize = spice_main_channel_finalize; gobject_class->get_property = spice_main_get_property; diff --git a/src/channel-playback.c b/src/channel-playback.c index be79868..f819491 100644 --- a/src/channel-playback.c +++ b/src/channel-playback.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include "spice-client.h" #include "spice-common.h" #include "spice-channel-priv.h" @@ -26,6 +28,9 @@ #include "common/snd_codec.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_playback); +#define SPICE_LOG_DOMAIN spice_log_domain_playback + /** * SECTION:channel-playback * @short_description: audio stream for playback @@ -119,6 +124,8 @@ static void spice_playback_channel_finalize(GObject *obj) if (G_OBJECT_CLASS(spice_playback_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_playback_channel_parent_class)->finalize(obj); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_playback); } static void spice_playback_channel_get_property(GObject *gobject, @@ -183,6 +190,8 @@ static void spice_playback_channel_class_init(SpicePlaybackChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_playback, "playback"); + gobject_class->finalize = spice_playback_channel_finalize; gobject_class->get_property = spice_playback_channel_get_property; gobject_class->set_property = spice_playback_channel_set_property; diff --git a/src/channel-port.c b/src/channel-port.c index 6e01caa..5d05444 100644 --- a/src/channel-port.c +++ b/src/channel-port.c @@ -17,12 +17,17 @@ */ #include "config.h" +#include "common/log.h" + #include "spice-client.h" #include "spice-common.h" #include "spice-channel-priv.h" #include "spice-marshal.h" #include "glib-compat.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_port); +#define SPICE_LOG_DOMAIN spice_log_domain_port + /** * SECTION:channel-port * @short_description: private communication channel @@ -113,6 +118,8 @@ static void spice_port_channel_finalize(GObject *object) if (G_OBJECT_CLASS(spice_port_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_port_channel_parent_class)->finalize(object); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_port); } static void spice_port_channel_reset(SpiceChannel *channel, gboolean migrating) @@ -130,6 +137,8 @@ static void spice_port_channel_class_init(SpicePortChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_port, "port"); + gobject_class->finalize = spice_port_channel_finalize; gobject_class->get_property = spice_port_get_property; channel_class->channel_reset = spice_port_channel_reset; diff --git a/src/channel-record.c b/src/channel-record.c index 1a17a0d..24b4bfc 100644 --- a/src/channel-record.c +++ b/src/channel-record.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include "spice-client.h" #include "spice-common.h" #include "spice-channel-priv.h" @@ -26,6 +28,9 @@ #include "common/snd_codec.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_record); +#define SPICE_LOG_DOMAIN spice_log_domain_record + /** * SECTION:channel-record * @short_description: audio stream for recording @@ -118,6 +123,8 @@ static void spice_record_channel_finalize(GObject *obj) if (G_OBJECT_CLASS(spice_record_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_record_channel_parent_class)->finalize(obj); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_record); } static void spice_record_channel_get_property(GObject *gobject, @@ -182,6 +189,8 @@ static void spice_record_channel_class_init(SpiceRecordChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_record, "record"); + gobject_class->finalize = spice_record_channel_finalize; gobject_class->get_property = spice_record_channel_get_property; gobject_class->set_property = spice_record_channel_set_property; diff --git a/src/channel-smartcard.c b/src/channel-smartcard.c index f8b30f1..291be10 100644 --- a/src/channel-smartcard.c +++ b/src/channel-smartcard.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #ifdef USE_SMARTCARD #include <vreader.h> #endif @@ -29,6 +31,9 @@ #include "smartcard-manager-priv.h" #include "spice-session-priv.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_smartcard); +#define SPICE_LOG_DOMAIN spice_log_domain_smartcard + /** * SECTION:channel-smartcard * @short_description: smartcard authentication @@ -184,6 +189,8 @@ static void spice_smartcard_channel_finalize(GObject *obj) if (G_OBJECT_CLASS(spice_smartcard_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_smartcard_channel_parent_class)->finalize(obj); + + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_smartcard); } static void spice_smartcard_channel_reset(SpiceChannel *channel, gboolean migrating) @@ -223,6 +230,8 @@ static void spice_smartcard_channel_class_init(SpiceSmartcardChannelClass *klass GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_smartcard, "smartcard"); + gobject_class->finalize = spice_smartcard_channel_finalize; gobject_class->constructed = spice_smartcard_channel_constructed; diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c index 418f32a..ca4665e 100644 --- a/src/channel-usbredir.c +++ b/src/channel-usbredir.c @@ -21,6 +21,8 @@ */ #include "config.h" +#include "common/log.h" + #ifdef USE_USBREDIR #include <glib/gi18n.h> #include <usbredirhost.h> @@ -38,6 +40,9 @@ #include "spice-channel-priv.h" #include "glib-compat.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_usbredir); +#define SPICE_LOG_DOMAIN spice_log_domain_usbredir + /** * SECTION:channel-usbredir * @short_description: usb redirection @@ -137,6 +142,8 @@ static void spice_usbredir_channel_class_init(SpiceUsbredirChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_usbredir, "usbredir"); + gobject_class->dispose = spice_usbredir_channel_dispose; gobject_class->finalize = spice_usbredir_channel_finalize; channel_class->channel_up = spice_usbredir_channel_up; @@ -189,6 +196,8 @@ static void spice_usbredir_channel_finalize(GObject *obj) /* Chain up to the parent class */ if (G_OBJECT_CLASS(spice_usbredir_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_usbredir_channel_parent_class)->finalize(obj); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_usbredir); } static void channel_set_handlers(SpiceChannelClass *klass) diff --git a/src/channel-webdav.c b/src/channel-webdav.c index 2a3e2f1..a5b3284 100644 --- a/src/channel-webdav.c +++ b/src/channel-webdav.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include "spice-client.h" #include "spice-common.h" #include "spice-channel-priv.h" @@ -26,6 +28,9 @@ #include "vmcstream.h" #include "giopipe.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_webdav); +#define SPICE_LOG_DOMAIN spice_log_domain_webdav + /** * SECTION:channel-webdav * @short_description: exports a directory @@ -546,6 +551,7 @@ static void spice_webdav_channel_finalize(GObject *object) g_free(c->demux.buf); G_OBJECT_CLASS(spice_webdav_channel_parent_class)->finalize(object); + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_webdav); } static void spice_webdav_channel_dispose(GObject *object) @@ -571,6 +577,8 @@ static void spice_webdav_channel_class_init(SpiceWebdavChannelClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceChannelClass *channel_class = SPICE_CHANNEL_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_webdav, "webdav"); + gobject_class->dispose = spice_webdav_channel_dispose; gobject_class->finalize = spice_webdav_channel_finalize; channel_class->handle_msg = spice_webdav_handle_msg; diff --git a/src/coroutine.h b/src/coroutine.h index c9694a8..78dc467 100644 --- a/src/coroutine.h +++ b/src/coroutine.h @@ -22,7 +22,6 @@ #define _COROUTINE_H_ #include "config.h" -#include "common/log.h" #if WITH_UCONTEXT #include "continuation.h" diff --git a/src/coroutine_gthread.c b/src/coroutine_gthread.c index abf149b..c21c027 100644 --- a/src/coroutine_gthread.c +++ b/src/coroutine_gthread.c @@ -20,6 +20,8 @@ #include "config.h" +#include "common/log.h" + #include "coroutine.h" #include <stdio.h> #include <stdlib.h> diff --git a/src/coroutine_ucontext.c b/src/coroutine_ucontext.c index 84499dc..5d3e738 100644 --- a/src/coroutine_ucontext.c +++ b/src/coroutine_ucontext.c @@ -21,6 +21,8 @@ #include "config.h" #include <glib.h> +#include "common/log.h" + #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif diff --git a/src/coroutine_winfibers.c b/src/coroutine_winfibers.c index dcd745d..cef6a53 100644 --- a/src/coroutine_winfibers.c +++ b/src/coroutine_winfibers.c @@ -22,6 +22,8 @@ #include <stdio.h> #include <glib.h> +#include "common/log.h" + #include "coroutine.h" static struct coroutine leader = { 0, }; diff --git a/src/decode-glz.c b/src/decode-glz.c index b55e9eb..e4f795b 100644 --- a/src/decode-glz.c +++ b/src/decode-glz.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <stdio.h> #include <stdbool.h> #include <inttypes.h> diff --git a/src/decode-jpeg.c b/src/decode-jpeg.c index 694178f..78e8716 100644 --- a/src/decode-jpeg.c +++ b/src/decode-jpeg.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include "decode.h" #ifdef G_OS_WIN32 diff --git a/src/decode-zlib.c b/src/decode-zlib.c index d49ce46..5f6e73c 100644 --- a/src/decode-zlib.c +++ b/src/decode-zlib.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include "decode.h" #ifndef __GNUC__ diff --git a/src/desktop-integration.c b/src/desktop-integration.c index db99a9b..01458f9 100644 --- a/src/desktop-integration.c +++ b/src/desktop-integration.c @@ -21,6 +21,8 @@ #include "config.h" +#include "common/log.h" + #include <glib-object.h> #include "glib-compat.h" diff --git a/src/giopipe.c b/src/giopipe.c index 77de1cf..01103ba 100644 --- a/src/giopipe.c +++ b/src/giopipe.c @@ -16,6 +16,8 @@ License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#include "common/log.h" + #include <string.h> #include <errno.h> diff --git a/src/map-file b/src/map-file index 62cdb51..da5d641 100644 --- a/src/map-file +++ b/src/map-file @@ -140,6 +140,10 @@ spice_util_get_version_string; spice_util_set_debug; spice_uuid_to_string; spice_webdav_channel_get_type; +spice_log; +SPICE_LOG_DOMAIN; +spice_log_domain_new; +spice_log_domain_free; local: *; }; diff --git a/src/smartcard-manager.c b/src/smartcard-manager.c index 908ade6..f367866 100644 --- a/src/smartcard-manager.c +++ b/src/smartcard-manager.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <glib-object.h> #include <string.h> @@ -33,6 +35,9 @@ #include "smartcard-manager-priv.h" #include "spice-marshal.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_smartcard_manager); +#define SPICE_LOG_DOMAIN spice_log_domain_smartcard_manager + /** * SECTION:smartcard-manager * @short_description: smartcard management @@ -134,12 +139,16 @@ static void spice_smartcard_manager_finalize(GObject *gobject) /* Chain up to the parent class */ if (G_OBJECT_CLASS(spice_smartcard_manager_parent_class)->finalize) G_OBJECT_CLASS(spice_smartcard_manager_parent_class)->finalize(gobject); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_smartcard_manager); } static void spice_smartcard_manager_class_init(SpiceSmartcardManagerClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_smartcard_manager, "smartcard"); + /** * SpiceSmartcardManager::reader-added: * @manager: the #SpiceSmartcardManager that emitted the signal diff --git a/src/spice-audio.c b/src/spice-audio.c index a494627..95818e7 100644 --- a/src/spice-audio.c +++ b/src/spice-audio.c @@ -34,6 +34,8 @@ #include "config.h" +#include "common/log.h" + #include "spice-client.h" #include "spice-common.h" @@ -51,6 +53,9 @@ #include "glib-compat.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_audio); +#define SPICE_LOG_DOMAIN spice_log_domain_audio + #define SPICE_AUDIO_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SPICE_TYPE_AUDIO, SpiceAudioPrivate)) @@ -74,6 +79,8 @@ static void spice_audio_finalize(GObject *gobject) if (G_OBJECT_CLASS(spice_audio_parent_class)->finalize) G_OBJECT_CLASS(spice_audio_parent_class)->finalize(gobject); + + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_audio); } static void spice_audio_get_property(GObject *gobject, @@ -123,6 +130,8 @@ static void spice_audio_class_init(SpiceAudioClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *pspec; + SPICE_LOG_DOMAIN_INIT(spice_log_domain_audio, "audio"); + gobject_class->finalize = spice_audio_finalize; gobject_class->get_property = spice_audio_get_property; gobject_class->set_property = spice_audio_set_property; diff --git a/src/spice-channel.c b/src/spice-channel.c index bb96449..c6ee285 100644 --- a/src/spice-channel.c +++ b/src/spice-channel.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include "spice-client.h" #include "spice-common.h" #include "glib-compat.h" @@ -48,6 +50,9 @@ #include "gio-coroutine.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_channel); +#define SPICE_LOG_DOMAIN spice_log_domain_channel + static void spice_channel_handle_msg(SpiceChannel *channel, SpiceMsgIn *msg); static void spice_channel_write_msg(SpiceChannel *channel, SpiceMsgOut *out); static void spice_channel_send_link(SpiceChannel *channel); @@ -194,6 +199,8 @@ static void spice_channel_finalize(GObject *gobject) /* Chain up to the parent class */ if (G_OBJECT_CLASS(spice_channel_parent_class)->finalize) G_OBJECT_CLASS(spice_channel_parent_class)->finalize(gobject); + + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_channel); } static void spice_channel_get_property(GObject *gobject, @@ -269,6 +276,8 @@ static void spice_channel_class_init(SpiceChannelClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_channel, "channel"); + klass->iterate_write = spice_channel_iterate_write; klass->iterate_read = spice_channel_iterate_read; klass->channel_reset = channel_reset; diff --git a/src/spice-common.h b/src/spice-common.h index edca065..8554f4c 100644 --- a/src/spice-common.h +++ b/src/spice-common.h @@ -30,7 +30,6 @@ #include "common/mem.h" #include "common/messages.h" #include "common/marshaller.h" -#include "common/log.h" #include "spice-util.h" diff --git a/src/spice-gstaudio.c b/src/spice-gstaudio.c index 91c0921..b200b4a 100644 --- a/src/spice-gstaudio.c +++ b/src/spice-gstaudio.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <gst/gst.h> #include <gst/app/gstappsrc.h> #include <gst/app/gstappsink.h> @@ -27,6 +29,9 @@ #include "spice-session.h" #include "spice-util.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_gstaudio); +#define SPICE_LOG_DOMAIN spice_log_domain_gstaudio + #define SPICE_GSTAUDIO_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_GSTAUDIO, SpiceGstaudioPrivate)) @@ -64,6 +69,7 @@ static gboolean spice_gstaudio_get_record_volume_info_finish(SpiceAudio *audio, static void spice_gstaudio_finalize(GObject *obj) { G_OBJECT_CLASS(spice_gstaudio_parent_class)->finalize(obj); + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_gstaudio); } void stream_dispose(struct stream *s) @@ -117,6 +123,8 @@ static void spice_gstaudio_class_init(SpiceGstaudioClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceAudioClass *audio_class = SPICE_AUDIO_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_gstaudio, "audio"); + audio_class->connect_channel = connect_channel; audio_class->get_playback_volume_info_async = spice_gstaudio_get_playback_volume_info_async; audio_class->get_playback_volume_info_finish = spice_gstaudio_get_playback_volume_info_finish; diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c index 88d41c5..9ee1709 100644 --- a/src/spice-gtk-session.c +++ b/src/spice-gtk-session.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <glib.h> #if HAVE_X11_XKBLIB_H @@ -46,6 +48,9 @@ #include "spice-util-priv.h" #include "spice-channel-priv.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_gtk_session); +#define SPICE_LOG_DOMAIN spice_log_domain_gtk_session + #define CLIPBOARD_LAST (VD_AGENT_CLIPBOARD_SELECTION_SECONDARY + 1) struct _SpiceGtkSessionPrivate { @@ -309,6 +314,8 @@ static void spice_gtk_session_finalize(GObject *gobject) /* Chain up to the parent class */ if (G_OBJECT_CLASS(spice_gtk_session_parent_class)->finalize) G_OBJECT_CLASS(spice_gtk_session_parent_class)->finalize(gobject); + + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_gtk_session); } static void spice_gtk_session_get_property(GObject *gobject, @@ -389,6 +396,8 @@ static void spice_gtk_session_class_init(SpiceGtkSessionClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_gtk_session, "gtk-session"); + gobject_class->constructor = spice_gtk_session_constructor; gobject_class->dispose = spice_gtk_session_dispose; gobject_class->finalize = spice_gtk_session_finalize; diff --git a/src/spice-option.c b/src/spice-option.c index 51ec801..4b583e1 100644 --- a/src/spice-option.c +++ b/src/spice-option.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <stdlib.h> #include <glib-object.h> #include <glib/gi18n.h> diff --git a/src/spice-pulse.c b/src/spice-pulse.c index b0f7b28..3970e61 100644 --- a/src/spice-pulse.c +++ b/src/spice-pulse.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include "spice-pulse.h" #include "spice-common.h" #include "spice-session-priv.h" @@ -28,6 +30,9 @@ #include <pulse/pulseaudio.h> #include <pulse/ext-stream-restore.h> +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_pulse); +#define SPICE_LOG_DOMAIN spice_log_domain_pulse + #define SPICE_PULSE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE((obj), SPICE_TYPE_PULSE, SpicePulsePrivate)) @@ -123,6 +128,7 @@ static void spice_pulse_finalize(GObject *obj) pa_glib_mainloop_free(p->mainloop); G_OBJECT_CLASS(spice_pulse_parent_class)->finalize(obj); + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_pulse); } static void spice_pulse_dispose(GObject *obj) @@ -176,6 +182,8 @@ static void spice_pulse_class_init(SpicePulseClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); SpiceAudioClass *audio_class = SPICE_AUDIO_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_pulse, "audio"); + audio_class->connect_channel = connect_channel; audio_class->get_playback_volume_info_async = spice_pulse_get_playback_volume_info_async; audio_class->get_playback_volume_info_finish = spice_pulse_get_playback_volume_info_finish; diff --git a/src/spice-session.c b/src/spice-session.c index e1d780f..562a5a9 100644 --- a/src/spice-session.c +++ b/src/spice-session.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <gio/gio.h> #include <glib.h> #ifdef G_OS_UNIX @@ -36,6 +38,9 @@ #include "channel-playback-priv.h" #include "spice-audio.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_session); +#define SPICE_LOG_DOMAIN spice_log_domain_session + struct channel { SpiceChannel *channel; RingItem link; @@ -381,6 +386,8 @@ spice_session_finalize(GObject *gobject) /* Chain up to the parent class */ if (G_OBJECT_CLASS(spice_session_parent_class)->finalize) G_OBJECT_CLASS(spice_session_parent_class)->finalize(gobject); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_session); } #define URI_SCHEME_SPICE "spice://" @@ -844,6 +851,8 @@ static void spice_session_class_init(SpiceSessionClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_session, "session"); + _wocky_http_proxy_get_type(); _wocky_https_proxy_get_type(); diff --git a/src/spice-uri.c b/src/spice-uri.c index e2c5c9a..90f00a9 100644 --- a/src/spice-uri.c +++ b/src/spice-uri.c @@ -23,6 +23,7 @@ #include "glib-compat.h" #include "spice-client.h" #include "spice-uri.h" +#include "common/log.h" /** * SECTION:spice-uri diff --git a/src/spice-util.c b/src/spice-util.c index d4b881d..c51b70f 100644 --- a/src/spice-util.c +++ b/src/spice-util.c @@ -18,6 +18,8 @@ */ #include "config.h" +#include "common/log.h" + #include <stdbool.h> #include <stdlib.h> #include <string.h> diff --git a/src/spice-util.h b/src/spice-util.h index 26a2264..d41140d 100644 --- a/src/spice-util.h +++ b/src/spice-util.h @@ -18,7 +18,6 @@ #ifndef SPICE_UTIL_H #define SPICE_UTIL_H -#include "common/log.h" #include <glib-object.h> G_BEGIN_DECLS diff --git a/src/spice-widget.c b/src/spice-widget.c index 6bd25d9..2d3e728 100644 --- a/src/spice-widget.c +++ b/src/spice-widget.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <math.h> #include <glib.h> @@ -44,6 +46,9 @@ #include "glib-compat.h" #include "gtk-compat.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_widget); +#define SPICE_LOG_DOMAIN spice_log_domain_widget + /* Some compatibility defines to let us build on both Gtk2 and Gtk3 */ /** @@ -467,6 +472,7 @@ static void spice_display_finalize(GObject *obj) } G_OBJECT_CLASS(spice_display_parent_class)->finalize(obj); + SPICE_LOG_DOMAIN_FINALIZE(spice_log_domain_widget); } static GdkCursor* get_blank_cursor(void) @@ -1809,6 +1815,8 @@ static void spice_display_class_init(SpiceDisplayClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS(klass); GtkWidgetClass *gtkwidget_class = GTK_WIDGET_CLASS(klass); + SPICE_LOG_DOMAIN_INIT(spice_log_domain_widget, "widget"); + #if GTK_CHECK_VERSION (2, 91, 0) gtkwidget_class->draw = draw_event; #else diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index 95f7d78..4b888dd 100644 --- a/src/usb-device-manager.c +++ b/src/usb-device-manager.c @@ -21,6 +21,8 @@ #include "config.h" +#include "common/log.h" + #include <glib-object.h> #include "glib-compat.h" @@ -51,6 +53,9 @@ #include <glib/gi18n.h> +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_usb_device_manager); +#define SPICE_LOG_DOMAIN spice_log_domain_usb_device_manager + #ifndef G_OS_WIN32 /* Linux -- device id is bus.addr */ #define DEV_ID_FMT "at %d.%d" #else /* Windows -- device id is vid:pid */ @@ -362,6 +367,8 @@ static void spice_usb_device_manager_finalize(GObject *gobject) /* Chain up to the parent class */ if (G_OBJECT_CLASS(spice_usb_device_manager_parent_class)->finalize) G_OBJECT_CLASS(spice_usb_device_manager_parent_class)->finalize(gobject); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_usb_device_manager); } static void spice_usb_device_manager_initable_iface_init(GInitableIface *iface) @@ -470,6 +477,8 @@ static void spice_usb_device_manager_class_init(SpiceUsbDeviceManagerClass *klas GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *pspec; + SPICE_LOG_DOMAIN_INIT (spice_log_domain_usb_device_manager, "usb"); + gobject_class->dispose = spice_usb_device_manager_dispose; gobject_class->finalize = spice_usb_device_manager_finalize; gobject_class->get_property = spice_usb_device_manager_get_property; diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c index d757698..7d1b77e 100644 --- a/src/usb-device-widget.c +++ b/src/usb-device-widget.c @@ -20,12 +20,18 @@ */ #include "config.h" + +#include "common/log.h" + #include <glib/gi18n.h> #include "glib-compat.h" #include "spice-client.h" #include "spice-marshal.h" #include "usb-device-widget.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_usb_device_widget); +#define SPICE_LOG_DOMAIN spice_log_domain_usb_device_widget + /** * SECTION:usb-device-widget * @short_description: USB device selection widget @@ -253,13 +259,17 @@ static void spice_usb_device_widget_finalize(GObject *object) if (G_OBJECT_CLASS(spice_usb_device_widget_parent_class)->finalize) G_OBJECT_CLASS(spice_usb_device_widget_parent_class)->finalize(object); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_usb_device_widget); } static void spice_usb_device_widget_class_init( SpiceUsbDeviceWidgetClass *klass) { GObjectClass *gobject_class = (GObjectClass *)klass; - GParamSpec *pspec; + GParamSpec *pspec; + + SPICE_LOG_DOMAIN_INIT (spice_log_domain_usb_device_widget, "usb"); g_type_class_add_private (klass, sizeof (SpiceUsbDeviceWidgetPrivate)); diff --git a/src/usbutil.c b/src/usbutil.c index 38ac921..7f19f0b 100644 --- a/src/usbutil.c +++ b/src/usbutil.c @@ -21,6 +21,8 @@ #include "config.h" +#include "common/log.h" + #include <glib-object.h> #include <glib/gi18n.h> #include <ctype.h> diff --git a/src/vmcstream.c b/src/vmcstream.c index 8f40b92..c962f66 100644 --- a/src/vmcstream.c +++ b/src/vmcstream.c @@ -17,6 +17,8 @@ */ #include "config.h" +#include "common/log.h" + #include <string.h> #include "vmcstream.h" @@ -24,6 +26,9 @@ #include "gio-coroutine.h" #include "glib-compat.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_vmcstream); +#define SPICE_LOG_DOMAIN spice_log_domain_vmcstream + struct _SpiceVmcInputStream { GInputStream parent_instance; @@ -76,6 +81,8 @@ spice_vmc_input_stream_class_init(SpiceVmcInputStreamClass *klass) { GInputStreamClass *istream_class; + SPICE_LOG_DOMAIN_INIT (spice_log_domain_vmcstream, "vmcstream"); + istream_class = G_INPUT_STREAM_CLASS(klass); istream_class->read_fn = spice_vmc_input_stream_read; istream_class->read_async = spice_vmc_input_stream_read_async; @@ -494,6 +501,7 @@ spice_vmc_stream_finalize(GObject *object) g_clear_object(&self->out); G_OBJECT_CLASS(spice_vmc_stream_parent_class)->finalize(object); + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_vmcstream); } static void diff --git a/src/vncdisplaykeymap.c b/src/vncdisplaykeymap.c index e113981..d412086 100644 --- a/src/vncdisplaykeymap.c +++ b/src/vncdisplaykeymap.c @@ -9,6 +9,8 @@ */ #include "config.h" +#include "common/log.h" + #include <gtk/gtk.h> #include <gdk/gdk.h> #include <gdk/gdkkeysyms.h> diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c index 3bdd697..9586479 100644 --- a/src/win-usb-dev.c +++ b/src/win-usb-dev.c @@ -22,6 +22,8 @@ #include "config.h" +#include "common/log.h" + #include <windows.h> #include <libusb.h> #include "win-usb-dev.h" @@ -29,6 +31,9 @@ #include "spice-util.h" #include "usbutil.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_usb_win); +#define SPICE_LOG_DOMAIN spice_log_domain_usb_win + #define G_UDEV_CLIENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE((obj), G_UDEV_TYPE_CLIENT, GUdevClientPrivate)) @@ -270,6 +275,8 @@ static void g_udev_client_finalize(GObject *gobject) /* Chain up to the parent class */ if (G_OBJECT_CLASS(g_udev_client_parent_class)->finalize) G_OBJECT_CLASS(g_udev_client_parent_class)->finalize(gobject); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_usb_win); } static void g_udev_client_class_init(GUdevClientClass *klass) @@ -278,6 +285,8 @@ static void g_udev_client_class_init(GUdevClientClass *klass) gobject_class->finalize = g_udev_client_finalize; + SPICE_LOG_DOMAIN_INIT (spice_log_domain_usb_win, "usb"); + signals[UEVENT_SIGNAL] = g_signal_new("uevent", G_OBJECT_CLASS_TYPE(klass), diff --git a/src/win-usb-driver-install.c b/src/win-usb-driver-install.c index 7bfb6d6..9578ddf 100644 --- a/src/win-usb-driver-install.c +++ b/src/win-usb-driver-install.c @@ -27,6 +27,8 @@ #include "config.h" +#include "common/log.h" + #include <windows.h> #include <gio/gio.h> #include <gio/gwin32inputstream.h> @@ -36,6 +38,9 @@ #include "win-usb-driver-install.h" #include "usb-device-manager-priv.h" +SPICE_LOG_DOMAIN_STATIC(spice_log_domain_usb_win_driver); +#define SPICE_LOG_DOMAIN spice_log_domain_usb_win_driver + /* ------------------------------------------------------------------ */ /* gobject glue */ @@ -99,12 +104,16 @@ static void spice_win_usb_driver_finalize(GObject *gobject) if (G_OBJECT_CLASS(spice_win_usb_driver_parent_class)->finalize) G_OBJECT_CLASS(spice_win_usb_driver_parent_class)->finalize(gobject); + + SPICE_LOG_DOMAIN_FINALIZE (spice_log_domain_usb_win_driver); } static void spice_win_usb_driver_class_init(SpiceWinUsbDriverClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + SPICE_LOG_DOMAIN_INIT (spice_log_domain_usb_win_driver, "usb"); + gobject_class->finalize = spice_win_usb_driver_finalize; g_type_class_add_private(klass, sizeof(SpiceWinUsbDriverPrivate)); -- 2.5.0 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel