diff --git a/Actions/ExternalTool.vala b/Actions/ExternalTool.vala index c615a82..40bf5e9 100644 --- a/Actions/ExternalTool.vala +++ b/Actions/ExternalTool.vala @@ -45,12 +45,12 @@ namespace IfThenElse private void child_watch_called(GLib.Pid p, int status) { GLib.Process.close_pid(p); - GLib.debug("Child watch called.\n"); + GLib.message("Child watch called.\n"); pid = 0; } private void start_application() { - GLib.debug("%s: %s", this.name, "start application"); + GLib.message("%s: %s", this.name, "start application"); if(kill_child) { stop_application(); @@ -59,13 +59,13 @@ namespace IfThenElse if(pid == 0) { string[] argv; - GLib.debug("Start application\n"); + GLib.message("Start application\n"); try { GLib.Shell.parse_argv(cmd, out argv); foreach (var s in argv) { - GLib.debug("argv: %s\n", s); + GLib.message("argv: %s\n", s); } GLib.Process.spawn_async(null, argv, null, SpawnFlags.SEARCH_PATH|SpawnFlags.DO_NOT_REAP_CHILD, null, out pid); @@ -79,7 +79,7 @@ namespace IfThenElse { if(pid > 0) { - GLib.debug("%s: Killing pid: %i\n",this.name, (int)pid); + GLib.message("%s: Killing pid: %i\n",this.name, (int)pid); Posix.kill((pid_t)pid, 1); } } @@ -90,7 +90,7 @@ namespace IfThenElse } public void Deactivate() { - GLib.debug("%s: Deactivate\n", this.name); + GLib.message("%s: Deactivate\n", this.name); stop_application(); } /** diff --git a/Actions/MultiAction.vala b/Actions/MultiAction.vala index b3fbbd3..28974da 100644 --- a/Actions/MultiAction.vala +++ b/Actions/MultiAction.vala @@ -61,7 +61,7 @@ namespace IfThenElse */ public void Deactivate() { - GLib.debug("%s: Deactivate\n", this.name); + GLib.message("%s: Deactivate\n", this.name); foreach(BaseAction action in actions) { action.Deactivate(); diff --git a/Base/BaseClass.vala b/Base/BaseClass.vala index 0c8545e..fd404b9 100644 --- a/Base/BaseClass.vala +++ b/Base/BaseClass.vala @@ -55,7 +55,7 @@ namespace IfThenElse ~Base() { - GLib.debug("Destroying: %s\n", this.name); + GLib.message("Destroying: %s\n", this.name); } /** * Check if it is a toplevel object. diff --git a/Base/Parser.vala b/Base/Parser.vala index e9aa92a..8e5fc80 100644 --- a/Base/Parser.vala +++ b/Base/Parser.vala @@ -43,7 +43,7 @@ namespace IfThenElse */ ~Parser() { - GLib.debug("Destroying parser\n"); + GLib.message("Destroying parser\n"); } /** @@ -56,7 +56,7 @@ namespace IfThenElse foreach(string group in kf.get_groups()) { var str_tp = kf.get_string(group, "type"); - GLib.debug("Creating object: %s\n", group); + GLib.message("Creating object: %s\n", group); GLib.Type tp = GLib.Type.from_name("IfThenElse"+str_tp); if(tp == 0) { GLib.error("Failed to lookup type: %s for %s\n",str_tp, group); @@ -82,13 +82,13 @@ namespace IfThenElse }catch(GLib.KeyFileError e) { GLib.error("Failed to parse keyfile: %s", e.message); } - GLib.debug("=== %s ===\n", group); + GLib.message("=== %s ===\n", group); foreach(var prop in keys) { // Skip the "Type" field. if(prop == "type") continue; - GLib.debug("Setting property: %s\n", prop); + GLib.message("Setting property: %s\n", prop); // Load property unowned ParamSpec? ps = object.get_class().find_property(prop); diff --git a/Checks/BaseCheck.vala b/Checks/BaseCheck.vala index e88d2ce..cf2aadb 100644 --- a/Checks/BaseCheck.vala +++ b/Checks/BaseCheck.vala @@ -62,7 +62,7 @@ namespace IfThenElse public void Activate() { BaseCheck.StateType state = this.check(); - GLib.debug("%s Activate: %i\n", this.name, (int)state); + GLib.message("%s Activate: %i\n", this.name, (int)state); // If no change, do nothing. if(state == BaseCheck.StateType.NO_CHANGE) return; @@ -87,7 +87,7 @@ namespace IfThenElse */ public void Deactivate() { - GLib.debug("%s Deactivate\n", this.name); + GLib.message("%s Deactivate\n", this.name); // Deactivate both. if(_then_action != null) _then_action.Deactivate(); diff --git a/Checks/ExternalToolCheck.vala b/Checks/ExternalToolCheck.vala index 4a43c34..a9ba630 100644 --- a/Checks/ExternalToolCheck.vala +++ b/Checks/ExternalToolCheck.vala @@ -93,7 +93,7 @@ namespace IfThenElse GLib.Process.spawn_command_line_sync(cmd, out output, null, out exit_value); exit_value = GLib.Process.exit_status(exit_value); - GLib.debug("output: %i:%s vs %s\n", exit_value, output, output_compare); + GLib.message("output: %i:%s vs %s\n", exit_value, output, output_compare); if(output_compare == null) { if(compare_old_state) diff --git a/Makefile b/Makefile index 8e7d458..383a559 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ PACKAGE_CHECK=.pkgcheck # VALAC magic. VALAC=valac VALAC_PACKAGES=$(foreach PKG, $(PACKAGES), --pkg=$(PKG)) -VALAC_FLAGS=-g $(VALAC_PACKAGES) --vapidir=./Vapi/ --pkg=posix +VALAC_FLAGS=-g $(VALAC_PACKAGES) --vapidir=./Vapi/ --pkg=posix VALADOC_DRIVER?=$(shell valac --version | awk -F' ' '{c= split($$2,B,"\."); printf "%s.%s.x", B[1], B[2]}') diff --git a/Triggers/BaseTrigger.vala b/Triggers/BaseTrigger.vala index 154bb3a..ab2630d 100644 --- a/Triggers/BaseTrigger.vala +++ b/Triggers/BaseTrigger.vala @@ -48,7 +48,7 @@ namespace IfThenElse public void Deactivate() { - GLib.debug("%s: Deactivate\n", this.name); + GLib.message("%s: Deactivate\n", this.name); if(_action != null) { _action.Deactivate(); } @@ -59,7 +59,7 @@ namespace IfThenElse */ public void fire() { - GLib.debug("Fire trigger: %p\n", _action); + GLib.message("Fire trigger: %p\n", _action); if(_action != null) { _action.Activate(); } diff --git a/Triggers/ExternalToolTrigger.vala b/Triggers/ExternalToolTrigger.vala index 2db3bc8..8e6da17 100644 --- a/Triggers/ExternalToolTrigger.vala +++ b/Triggers/ExternalToolTrigger.vala @@ -55,7 +55,7 @@ namespace IfThenElse private void child_watch_called(GLib.Pid p, int status) { GLib.Process.close_pid(pid); - GLib.debug("Child watch called.\n"); + GLib.message("Child watch called.\n"); pid = 0; if(status == 0) { @@ -68,13 +68,13 @@ namespace IfThenElse if(pid == 0) { string[] argv; - GLib.debug("Start application\n"); + GLib.message("Start application\n"); try { GLib.Shell.parse_argv(cmd, out argv); foreach (var s in argv) { - GLib.debug("argv: %s\n", s); + GLib.message("argv: %s\n", s); } GLib.Process.spawn_async(null, argv, null, SpawnFlags.SEARCH_PATH|SpawnFlags.DO_NOT_REAP_CHILD, null, out pid); @@ -88,7 +88,7 @@ namespace IfThenElse { if(pid > 0) { - GLib.debug("%s: Killing pid: %i\n",this.name, (int)pid); + GLib.message("%s: Killing pid: %i\n",this.name, (int)pid); Posix.kill((pid_t)pid, 1); } } diff --git a/Triggers/OutputWatch.vala b/Triggers/OutputWatch.vala index 8986d46..2905f6e 100644 --- a/Triggers/OutputWatch.vala +++ b/Triggers/OutputWatch.vala @@ -73,11 +73,11 @@ namespace IfThenElse size_t length, term_pos; try{ source.read_line(out retv, out length, out term_pos); - GLib.debug("Read: %s\n", retv); + GLib.message("Read: %s\n", retv); // continue to watch. var regex = new GLib.Regex (fire_regex); if(regex.match(retv)) { - GLib.debug("Fire: %s\n", retv); + GLib.message("Fire: %s\n", retv); this.fire(); } }catch(GLib.Error e) { @@ -94,7 +94,7 @@ namespace IfThenElse private void child_watch_called(GLib.Pid p, int status) { GLib.Process.close_pid(p); - GLib.debug("Child watch called: %i.\n", (int)p); + GLib.message("Child watch called: %i.\n", (int)p); pid = 0; if(output_watch > 0){ GLib.Source.remove(output_watch); @@ -116,14 +116,14 @@ namespace IfThenElse if(pid == 0) { string[] argv; - GLib.debug("Start application\n"); + GLib.message("Start application\n"); try { int standard_output = -1; GLib.Shell.parse_argv(cmd, out argv); foreach (var s in argv) { - GLib.debug("argv: %s\n", s); + GLib.message("argv: %s\n", s); } GLib.Process.spawn_async_with_pipes( null, argv, null, @@ -143,7 +143,7 @@ namespace IfThenElse { if(pid > 0) { - GLib.debug("%s: Killing pid: %i\n",this.name, (int)pid); + GLib.message("%s: Killing pid: %i\n",this.name, (int)pid); Posix.kill((pid_t)pid, 1); // Disconnect all signals. child_watch_called(pid, 1); diff --git a/Triggers/TimeTrigger.vala b/Triggers/TimeTrigger.vala index 95ae73f..358dfb0 100644 --- a/Triggers/TimeTrigger.vala +++ b/Triggers/TimeTrigger.vala @@ -143,7 +143,7 @@ namespace IfThenElse // time has past, so next day. remaining_time+=24*60*60; } - GLib.debug("Remaining seconds: %i\n", remaining_time); + GLib.message("Remaining seconds: %i\n", remaining_time); handler = GLib.Timeout.add_seconds(remaining_time, timer_callback); diff --git a/Triggers/Timer.vala b/Triggers/Timer.vala index 8b74aa5..357108d 100644 --- a/Triggers/Timer.vala +++ b/Triggers/Timer.vala @@ -72,7 +72,7 @@ namespace IfThenElse */ private bool timer_callback() { - GLib.debug("Timer fire\n"); + GLib.message("Timer fire\n"); this.fire(); return true; } diff --git a/main.vala b/main.vala index 33ba7a4..f85a3d6 100644 --- a/main.vala +++ b/main.vala @@ -259,7 +259,7 @@ namespace IfThenElse */ private void reload_files() { - GLib.debug("Reload...."); + GLib.message("Reload...."); stop(); load_argument(); start(); @@ -284,12 +284,12 @@ namespace IfThenElse quit_program(); if (strsignal (signo) != null) { - GLib.debug ("Received signal:%d->'%s'", signo, strsignal (signo)); + GLib.message ("Received signal:%d->'%s'", signo, strsignal (signo)); } break; default: if (strsignal (signo) != null) { - GLib.debug ("Received signal:%d->'%s'", signo, strsignal (signo)); + GLib.message ("Received signal:%d->'%s'", signo, strsignal (signo)); } break; } @@ -303,7 +303,7 @@ namespace IfThenElse { if(force || GLib.Regex.match_simple(".*\\.ife$", file)) { - GLib.debug("Load file: %s", file); + GLib.message("Load file: %s", file); try{ parser.add_from_file(file); }catch(GLib.Error e) { @@ -313,7 +313,7 @@ namespace IfThenElse } else { - GLib.debug("Ignoring: %s\n", file); + GLib.message("Ignoring: %s\n", file); } } /** @@ -467,7 +467,8 @@ namespace IfThenElse // Log handler GLib.Log.set_handler(null, - GLib.LogLevelFlags.LEVEL_INFO|GLib.LogLevelFlags.LEVEL_DEBUG, + GLib.LogLevelFlags.LEVEL_INFO|GLib.LogLevelFlags.LEVEL_DEBUG| + GLib.LogLevelFlags.LEVEL_MESSAGE, my_log_handler); // Load the setup file. @@ -510,10 +511,10 @@ namespace IfThenElse start(); loop.run(); - GLib.debug("Quit...."); + GLib.message("Quit...."); stop(); - GLib.debug("Cleanup...."); + GLib.message("Cleanup...."); // Destroy parser = null; return 0;