]> git.saurik.com Git - redis.git/commitdiff
timestamp in log lines
authorantirez <antirez@gmail.com>
Mon, 11 May 2009 17:45:47 +0000 (19:45 +0200)
committerantirez <antirez@gmail.com>
Mon, 11 May 2009 17:45:47 +0000 (19:45 +0200)
redis.c

diff --git a/redis.c b/redis.c
index 7f1cc3b6187541a1a49806833b732e45c77e5d47..39e85124beefa486a859f7904a863d65936f9a48 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -556,7 +556,12 @@ void redisLog(int level, const char *fmt, ...)
     va_start(ap, fmt);
     if (level >= server.verbosity) {
         char *c = ".-*";
-        fprintf(fp,"%c ",c[level]);
+        char buf[64];
+        time_t now;
+
+        now = time(NULL);
+        strftime(buf,64,"%d %b %H:%M:%S",gmtime(&now));
+        fprintf(fp,"%s %c ",buf,c[level]);
         vfprintf(fp, fmt, ap);
         fprintf(fp,"\n");
         fflush(fp);