[rygel] core,data: Compatibility with old style log configs



commit d910a95c3a364c5bc8f2cab0217f2990f997293b
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Feb 10 00:37:20 2011 +0200

    core,data: Compatibility with old style log configs
    
    Allow log level to be specified in the old style, i-e just a number.

 src/rygel/rygel-log-handler.vala |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/rygel/rygel-log-handler.vala b/src/rygel/rygel-log-handler.vala
index 514d908..3fc963f 100644
--- a/src/rygel/rygel-log-handler.vala
+++ b/src/rygel/rygel-log-handler.vala
@@ -71,13 +71,22 @@ public class Rygel.LogHandler : GLib.Object {
 
         foreach (var pair in log_levels.split (",")) {
             var tokens = pair.split (":");
-            if (unlikely (tokens.length < 2)) {
+            if (tokens.length < 1) {
                 break;
             }
 
-            var domain = tokens[0];
-            var levels = (LogLevel) tokens[1].to_int ();
-            var flags = this.log_level_to_flags (levels);
+            string domain;
+            LogLevel level;
+
+            if (tokens.length == 1) {
+                level = (LogLevel) tokens[0].to_int ();
+                domain = "*";
+            } else {
+                domain = tokens[0];
+                level = (LogLevel) tokens[1].to_int ();
+            }
+
+            var flags = this.log_level_to_flags (level);
 
             this.log_level_hash[domain] = flags;
         }



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