[rygel/wip/didl-s: 12/14] core: Force debug output if Debug is set anywhere
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/wip/didl-s: 12/14] core: Force debug output if Debug is set anywhere
- Date: Wed, 14 Nov 2012 11:34:54 +0000 (UTC)
commit 335d8d9b9d7046cb621596513375e961f23e5e78
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]