[rygel/wip/didl-s: 7/8] core: Force debug output if Debug is set anywhere



commit 2ee00c962191008e8a84c7fb99d4aab9ce361c63
Author: Jens Georg <jensg openismus com>
Date:   Fri Nov 2 13:21:32 2012 +0100

    core: Force debug output if Debug is set anywhere

 src/librygel-core/rygel-log-handler.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-core/rygel-log-handler.vala b/src/librygel-core/rygel-log-handler.vala
index b4ccd4a..390ec2f 100644
--- a/src/librygel-core/rygel-log-handler.vala
+++ b/src/librygel-core/rygel-log-handler.vala
@@ -69,6 +69,7 @@ public class Rygel.LogHandler : GLib.Object {
                      err.message);
         }
 
+        var do_debug = false;
         foreach (var pair in log_levels.split (",")) {
             var tokens = pair.split (":");
             if (tokens.length < 1) {
@@ -86,11 +87,17 @@ public class Rygel.LogHandler : GLib.Object {
                 level = (LogLevel) int.parse (tokens[1]);
             }
 
+            do_debug |= (level == LogLevel.DEBUG);
+
             var flags = this.log_level_to_flags (level);
 
             this.log_level_hash[domain] = flags;
         }
 
+        if (do_debug) {
+            Environment.set_variable ("G_MESSAGES_DEBUG", "all", false);
+        }
+
         Log.set_default_handler (this.log_func);
     }
 



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