aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-04-24 22:09:05 +0200
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-04-24 22:09:05 +0200
commit7505d442626381200cd998a03df87b5f688d4c99 (patch)
tree3b45626a7e5d418a133d1106e2148c3a36c60d45 /uzbl.c
parentee54b47b4a24cbea013ab86a2c65454a5a0a8776 (diff)
prepend log entries with date in "%Y-%m-%d %H:%M:%S" format for easy grepping
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/uzbl.c b/uzbl.c
index 529a5e2..d27ccdf 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -59,7 +59,14 @@ log_history_cb () {
if (output_file == NULL) {
fprintf(stderr, "Cannot open %s for logging\n", history_file);
} else {
- fprintf(output_file, "%s\n",uri); //TODO prepend date in Y-m-d H:i:s format for easy grepping :)
+ time_t rawtime;
+ struct tm * timeinfo;
+ char buffer [80];
+ time ( &rawtime );
+ timeinfo = localtime ( &rawtime );
+ strftime (buffer,80,"%Y-%m-%d %H:%M:%S",timeinfo);
+
+ fprintf(output_file, "%s %s\n",buffer, uri);
fclose(output_file);
}
}