[Xfce4-commits] <postler:master> Recognise POSTLER_DEBUG and propagate to the service
Christian Dywan
noreply at xfce.org
Fri Dec 17 00:40:01 CET 2010
Updating branch refs/heads/master
to 3e8774e7d77d8a58d8717b38d1d187bd5ffb3e54 (commit)
from 6e03da94391574b465419c1ccb15ef1844a1c3b6 (commit)
commit 3e8774e7d77d8a58d8717b38d1d187bd5ffb3e54
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Dec 16 22:55:14 2010 +0100
Recognise POSTLER_DEBUG and propagate to the service
So the service enables verbose output in the same console
if run by an instance that has verbose output.
postler/postler-client.vala | 4 +---
postler/postler-reader.vala | 7 ++++++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/postler/postler-client.vala b/postler/postler-client.vala
index 9f89efa..ddcdcc2 100644
--- a/postler/postler-client.vala
+++ b/postler/postler-client.vala
@@ -32,9 +32,7 @@ namespace Postler {
/* Ensure Postler is running, ignore errors */
Process.spawn_async (null,
{ Postler.App.argv0, "-m", "service" }, null,
- SpawnFlags.SEARCH_PATH
- | SpawnFlags.STDOUT_TO_DEV_NULL
- | SpawnFlags.STDERR_TO_DEV_NULL,
+ SpawnFlags.SEARCH_PATH,
null, null);
} catch (GLib.Error error) { }
}
diff --git a/postler/postler-reader.vala b/postler/postler-reader.vala
index e5b0d1b..a0ddfbd 100644
--- a/postler/postler-reader.vala
+++ b/postler/postler-reader.vala
@@ -51,7 +51,12 @@ public class Postler.Reader {
return 0;
}
- if (!verbose) {
+ /* --verbose or POSTLER_DEBUG=1 enables debug messages */
+ unowned string? debug = Environment.get_variable ("POSTLER_DEBUG");
+ if (verbose || debug == "1") {
+ Environment.set_variable ("POSTLER_DEBUG", "1", false);
+ }
+ else {
LogFunc handler = (domain, level, message) => { };
Log.set_handler (null, LogLevelFlags.LEVEL_DEBUG, handler);
}
More information about the Xfce4-commits
mailing list