[ostree: 10/70] main: Set log handler for OSTree domain



commit b1e1e5166018aac690af841232a1a2c9c1d835c4
Author: Dan Nicholson <nicholson endlessm com>
Date:   Sat Mar 26 08:35:30 2016 -0700

    main: Set log handler for OSTree domain
    
    Now that OSTree is used as G_LOG_DOMAIN, set the main handler to match
    so the appropriate messages are filtered. It would probably be more
    appropriate to spell out "OSTree" in the code, but since G_LOG_DOMAIN is
    being defined globally in the project, might as well reuse it here.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764237
    
    Closes: #225
    Approved by: cgwalters

 src/ostree/ot-main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index 51282f9..93f841d 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -132,7 +132,7 @@ ostree_run (int    argc,
   /* avoid gvfs (http://bugzilla.gnome.org/show_bug.cgi?id=526454) */
   g_setenv ("GIO_USE_VFS", "local", TRUE);
 
-  g_log_set_handler (NULL, G_LOG_LEVEL_MESSAGE, message_handler, NULL);
+  g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, message_handler, NULL);
 
   /*
    * Parse the global options. We rearrange the options as
@@ -255,7 +255,7 @@ ostree_option_context_parse (GOptionContext *context,
     }
 
   if (opt_verbose)
-    g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, message_handler, NULL);
+    g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, message_handler, NULL);
 
   if (opt_repo == NULL && !(flags & OSTREE_BUILTIN_FLAG_NO_REPO))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]