[tracker] Silence libmediaart log messages
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] Silence libmediaart log messages
- Date: Thu, 9 Jun 2016 14:29:34 +0000 (UTC)
commit 0a92485009f08cb2872325d9c6627343134fbcc9
Author: Sam Thursfield <sam afuera me uk>
Date: Thu Jun 9 13:54:26 2016 +0100
Silence libmediaart log messages
This was removed in commit 2454185dd8a8459c45e4d32e0c3602f14647bbdd, but
it is actually still needed to hide log messages from libmediaart when
running `tracker-extract --verbosity=0`.
The mistake of reusing the same variable to store both log handler IDs
is now fixed.
src/libtracker-common/tracker-log.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-common/tracker-log.c b/src/libtracker-common/tracker-log.c
index d300ee7..1405679 100644
--- a/src/libtracker-common/tracker-log.c
+++ b/src/libtracker-common/tracker-log.c
@@ -38,6 +38,7 @@ static gboolean initialized;
static FILE *fd;
static gint verbosity;
static guint log_handler_id;
+static guint libmediaart_log_handler_id;
static gboolean use_log_files;
static GMutex mutex;
@@ -267,6 +268,11 @@ tracker_log_init (gint this_verbosity,
hide_levels,
hide_log_handler,
NULL);
+
+ libmediaart_log_handler_id = g_log_set_handler ("libmediaart",
+ hide_levels,
+ hide_log_handler,
+ NULL);
}
/* Set log handler function for the rest */
@@ -297,6 +303,11 @@ tracker_log_shutdown (void)
log_handler_id = 0;
}
+ if (libmediaart_log_handler_id) {
+ g_log_remove_handler (G_LOG_DOMAIN, libmediaart_log_handler_id);
+ libmediaart_log_handler_id = 0;
+ }
+
if (use_log_files && fd != NULL) {
fclose (fd);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]