zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #04512
[Branch ~zeitgeist/zeitgeist/bluebird] Rev 362: Don't display debug messages by default
------------------------------------------------------------
revno: 362
committer: Michal Hruby <michal.mhr@xxxxxxxxx>
branch nick: bluebird
timestamp: Mon 2012-01-02 20:30:51 +0100
message:
Don't display debug messages by default
modified:
src/sql.vala
src/zeitgeist-daemon.vala
--
lp:zeitgeist
https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird
Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.
To unsubscribe from this branch go to https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird/+edit-subscription
=== modified file 'src/sql.vala'
--- src/sql.vala 2011-12-31 18:15:06 +0000
+++ src/sql.vala 2012-01-02 19:30:51 +0000
@@ -67,6 +67,7 @@
public ZeitgeistDatabase () throws EngineError
{
+ message ("Opening DB from %s", Utils.get_database_file_path ());
int rc = Sqlite.Database.open_v2 (
Utils.get_database_file_path (),
out database);
=== modified file 'src/zeitgeist-daemon.vala'
--- src/zeitgeist-daemon.vala 2011-10-20 14:20:17 +0000
+++ src/zeitgeist-daemon.vala 2012-01-02 19:30:51 +0000
@@ -60,7 +60,7 @@
null
},
{
- "quit", 0, 0, OptionArg.NONE, out quit_daemon,
+ "quit", 'q', 0, OptionArg.NONE, out quit_daemon,
"Quit running Zeitgeist daemon instance", null
},
{
@@ -437,6 +437,39 @@
return 0;
}
+
+ LogLevelFlags discarded = LogLevelFlags.LEVEL_DEBUG;
+ if (log_level != null)
+ {
+ var ld = LogLevelFlags.LEVEL_DEBUG;
+ var li = LogLevelFlags.LEVEL_INFO;
+ var lm = LogLevelFlags.LEVEL_MESSAGE;
+ var lw = LogLevelFlags.LEVEL_WARNING;
+ var lc = LogLevelFlags.LEVEL_CRITICAL;
+ switch (log_level)
+ {
+ case "DEBUG":
+ discarded = 0;
+ break;
+ case "INFO":
+ discarded = ld;
+ break;
+ case "WARNING":
+ discarded = ld | li | lm;
+ break;
+ case "CRITICAL":
+ discarded = ld | li | lm | lw;
+ break;
+ case "ERROR":
+ discarded = ld | li | lm | lw | lc;
+ break;
+ }
+ }
+ if (discarded != 0)
+ {
+ Log.set_handler ("", discarded, () => {});
+ }
+
run ();
}
catch (Error err)