From 15a65b6166fded878450eda7a1d02aef85760686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Forysiuk?= Date: Sun, 29 May 2011 17:13:08 +0200 Subject: [PATCH] Add timestamps if logging to a file And try to match appearance of console messages. --- midori/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/midori/main.c b/midori/main.c index b3db3067..948f2287 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1876,6 +1876,7 @@ midori_log_to_file (const gchar* log_domain, { FILE* logfile = fopen ((const char*)user_data, "a"); gchar* level_name = ""; + time_t timestamp = time (NULL); switch (log_level) { @@ -1904,7 +1905,7 @@ midori_log_to_file (const gchar* log_domain, break; } - fprintf (logfile, "%s %s: %s\n", + fprintf (logfile, "%s%s-%s **: %s\n", asctime (localtime (×tamp)), log_domain ? log_domain : "Midori", level_name, message); fclose (logfile); }