sync
authorjohn <john@roojs.com>
Thu, 10 May 2018 09:19:58 +0000 (17:19 +0800)
committerjohn <john@roojs.com>
Thu, 10 May 2018 09:19:58 +0000 (17:19 +0800)
GitMonitor.vala
GitRepo.vala
Gitlive.vala

index e149696..c164597 100644 (file)
@@ -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..
 
index d69a112..7cf9538 100644 (file)
@@ -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();             
index 40d4c46..e3ded34 100644 (file)
@@ -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";