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



commit ccb78f515f138c02b64da9c189001fc47900b9b0
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]