fix empty log
[gitlive] / Gitlive.vala
1
2
3 /*
4  valac  --pkg gio-2.0  --pkg posix  --pkg gtk+-3.0 --pkg libnotify --pkg  libwnck-3.0 \
5       Gitlive.vala \
6       Monitor.vala \
7       GitMonitor.vala \
8       Spawn.vala \
9       StatusIcon.vala \
10       GitRepo.vala \
11     xorg_idletime.c \
12     WindowLog.vala \
13     --Xcc=-lXss \
14     --Xcc=-DWNCK_I_KNOW_THIS_IS_UNSTABLE \
15     -o /tmp/Gitlive && /tmp/Gitlive
16
17
18
19 */
20
21
22
23
24
25 static int main (string[] args) {
26
27         //GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL); 
28
29   GLib.Log.set_handler(null, 
30             GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING | GLib.LogLevelFlags.LEVEL_INFO, 
31             (dom, lvl, msg) => {
32                                         
33                                         
34                // should we debug..
35                                         
36                         
37                print("%s\n", msg);
38             }
39          ); 
40
41         Ggit.init();
42     Gtk.init (ref args);
43     
44     GitMonitor.gitlive =  Environment.get_home_dir() + "/gitlive";
45
46     print("GitMonitor.gitlive=" + GitMonitor.gitlive);
47
48     Notify.init("gitlive");
49
50     new StatusIconA();
51     var gm = new GitMonitor();
52
53
54     Timeout.add_full(Priority.LOW, 500, () => {
55         // this should start after we have shown the icon...
56         print("adding GitMonitor.gitlive: " + GitMonitor.gitlive);
57         gm.add(GitMonitor.gitlive);
58         print("gm.start()");
59         gm.start();
60
61         new WindowLog();
62
63         return false;
64
65     });
66
67     Gtk.main ();
68
69     return 0;
70
71 }