Permalink
Browse files

Move to g_message instead of g_debug

  • Loading branch information...
1 parent bf60a69 commit cd92c4908a17e33d07d4413f4c57c346e296d1e2 @DaveDavenport committed Jan 7, 2012
View
@@ -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();
}
/**
View
@@ -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();
View
@@ -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.
View
@@ -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);
View
@@ -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();
@@ -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)
View
@@ -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]}')
@@ -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();
}
@@ -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);
}
}
View
@@ -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);
@@ -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);
View
@@ -72,7 +72,7 @@ namespace IfThenElse
*/
private bool timer_callback()
{
- GLib.debug("Timer fire\n");
+ GLib.message("Timer fire\n");
this.fire();
return true;
}
View
@@ -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;

0 comments on commit cd92c49

Please sign in to comment.