diff options
-rw-r--r-- | log.vala | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); |