From 8163c0c30a72cd5eaf8be4436c306138e90044a8 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 10 May 2018 17:19:58 +0800 Subject: [PATCH] sync --- GitMonitor.vala | 2 +- GitRepo.vala | 14 +++++++------- Gitlive.vala | 13 +++++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/GitMonitor.vala b/GitMonitor.vala index e1496964..c1645979 100644 --- a/GitMonitor.vala +++ b/GitMonitor.vala @@ -300,7 +300,7 @@ public class GitMonitor : Monitor notification.set_timeout(5); notification.show(); } catch(Error e) { - GLib.debug("Error %s\n",e.message); + GLib.debug("Error sending notification to screen: %s\n",e.message); } return false; // do not keep doing this.. diff --git a/GitRepo.vala b/GitRepo.vala index d69a112a..7cf95383 100644 --- a/GitRepo.vala +++ b/GitRepo.vala @@ -73,7 +73,7 @@ public class GitRepo : Object } } catch (Error e) { - print("Error: %s\n",e.message); + GLib.debug("Error: %s\n",e.message); break; } @@ -328,8 +328,8 @@ public class GitRepo : Object //this.lastCmd = args.join(" "); //if(this.debug) { - stdout.printf( "CWD=%s\n", this.git_working_dir ); - print( "cmd: %s\n", string.joinv (" ", args)); + GLib.debug( "CWD=%s\n", this.git_working_dir ); + GLib.debug( "cmd: %s\n", string.joinv (" ", args)); //} string[] env = {}; @@ -348,7 +348,7 @@ public class GitRepo : Object var sp = new Spawn(cfg); - stdout.printf( "GOT: %s\n" , sp.output); + GLib.debug( "GOT: %s\n" , sp.output); // parse output for some commands ? return sp.output; } @@ -374,8 +374,8 @@ public class GitRepo : Object //this.lastCmd = args.join(" "); //if(this.debug) { - stdout.printf( "CWD=%s\n", this.git_working_dir ); - print( "cmd: %s\n", string.joinv (" ", args)); + GLib.debug( "CWD=%s\n", this.git_working_dir ); + //print( "cmd: %s\n", string.joinv (" ", args)); //} string[] env = {}; @@ -401,7 +401,7 @@ public class GitRepo : Object void git_async_on_complete(int err, string output) { - print("GOT %s\n", output); + GLib.debug("GOT %s\n", output); this.git_async_on_callback(this, output); // this.unref(); // sp.unref(); diff --git a/Gitlive.vala b/Gitlive.vala index 40d4c461..e3ded342 100644 --- a/Gitlive.vala +++ b/Gitlive.vala @@ -26,6 +26,19 @@ static int main (string[] args) { //GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL); + GLib.Log.set_handler(null, + GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING | GLib.LogLevelFlags.LEVEL_INFO, + (dom, lvl, msg) => { + + + // should we debug.. + + + print("%s\n", msg); + } + ); + + Gtk.init (ref args); GitMonitor.gitlive = Environment.get_home_dir() + "/gitlive"; -- 2.39.2