return this.getStatus();
} );
//Roo.log("Windowlog start");
- this.screen.active_window_changed.connect((pr_win) => {
- this.windowChanged();
- });
+ this.screen.active_window_changed.connect( this.windowChanged );
}
try {
this.write("", "IDLE");
} catch (Error e) {
- print(e.message + "\n");
+ GLib.debug("%s",e.message);
}
}
this.win = "";
return true;
}
- public void windowChanged()
+ public void windowChanged(Wnck.Window? pr_win)
{
this.screen.force_update();
// print("window changeD");
//print("PID " + pid);
//var cmd = File.realpath('/proc/'+ pid + '/exe');
string cmd = "";
- size_t len = 0;
- print("/proc/%u/cmdline".printf(pid) + "\n");
+
+ // print("/proc/%u/cmdline".printf(pid) + "\n");
if (pid > 0 ) {
var cf = File.new_for_path("/proc/%u/cmdline".printf(pid));
cmd = "UNKNOWN";
}
// has it changed?
- print(this.win +"\n" + cmd + "\n");
+ //print(this.win +"\n" + cmd + "\n");
if (this.win.length < 1 || (win != this.win)) {
//print((xDate.newDate()).format("Y-m-d H:i:s") + " " + win + ' - '+ cmd );
this.win=win;
}
} catch (Error e) {
- print(e.message + "\n");
+ GLib.debug("%s",e.message);
}
var now = new DateTime.now(new TimeZone.local());
var dir = this.outdir + now.format("/%Y/%m");
- print(dir + "\n");
+ //print(dir + "\n");
if (this.lastdir.length < 1 || this.lastdir != dir) {
this.lastdir = dir;
}
-
+
var fname = now.format("/%d") + ".log";
var path = dir + "/" + fname;
var time = now.format("%H:%M:%S ");
- print("time: " + time + "\n");
+ //print("time: " + time + "\n");
var f = File.new_for_path(path);
- FileOutputStream ios = f.append_to (FileCreateFlags.NONE);
+ var ios = f.append_to (FileCreateFlags.NONE);
var data_out = new DataOutputStream (ios);
data_out.put_string("\n" +time + str + " " + cmd, null);
- print(time + str + " " + cmd + "\n");
+ GLib.debug("%s%s %s",time , str , cmd);
data_out.close(null);