[Xfce4-commits] <midori:master> Add timestamps if logging to a file

Christian Dywan noreply at xfce.org
Thu Jun 2 01:12:01 CEST 2011


Updating branch refs/heads/master
         to 15a65b6166fded878450eda7a1d02aef85760686 (commit)
       from fc842d9751c84bf742b47d1ac6d0246bb53e92ff (commit)

commit 15a65b6166fded878450eda7a1d02aef85760686
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Sun May 29 17:13:08 2011 +0200

    Add timestamps if logging to a file
    
    And try to match appearance of console messages.

 midori/main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index b3db306..948f228 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 (&timestamp)),
         log_domain ? log_domain : "Midori", level_name, message);
     fclose (logfile);
 }



More information about the Xfce4-commits mailing list