summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--log.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/log.vala b/log.vala
index a4f9842..71b5875 100644
--- a/log.vala
+++ b/log.vala
@@ -1,16 +1,21 @@
namespace Log {
private unowned FileStream file;
private FileStream fileowner;
+ private long start_timestamp;
public void init() {
+ TimeVal time = {0};
+ time.get_current_time();
+
set_file(cfg.get_string("config", "logfile"));
GLib.Log.set_default_handler(log_handler);
+ start_timestamp = time.tv_sec;
}
private void log_handler(string? domain, LogLevelFlags flags, string message) {
TimeVal time = {0};
time.get_current_time();
- string s = "%.10ld | %15s | %s\n".printf(time.tv_usec, domain, message);
+ string s = "%.10ld | %15s | %s\n".printf(time.tv_sec - start_timestamp, domain, message);
if(file != null) {
file.printf(s);