[FFmpeg-cvslog] r13863 - trunk/ffserver.c

bcoudurier subversion
Sun Jun 22 03:08:49 CEST 2008


Author: bcoudurier
Date: Sun Jun 22 03:08:48 2008
New Revision: 13863

Log:
print date in http_log

Modified:
   trunk/ffserver.c

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	(original)
+++ trunk/ffserver.c	Sun Jun 22 03:08:48 2008
@@ -306,10 +306,19 @@ static FILE *logfile = NULL;
 
 static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ...)
 {
+    static int print_prefix = 1;
     va_list ap;
     va_start(ap, fmt);
 
     if (logfile) {
+        if (print_prefix) {
+            time_t current = time(0);
+            char buffer[32];
+            strncpy(buffer, ctime(&current), 31);
+            buffer[strlen(buffer)-1] = 0; // remove '\n'
+            fprintf(logfile, "%s ", buffer);
+        }
+        print_prefix = strstr(fmt, "\n") != NULL;
         vfprintf(logfile, fmt, ap);
         fflush(logfile);
     }




More information about the ffmpeg-cvslog mailing list