diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-22 01:08:48 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-22 01:08:48 +0000 |
commit | 124ed1c07307c28815850d0dc666d12547afc015 (patch) | |
tree | fd4cd37aa68e36651522cf9fd60e76037fd09c82 /ffserver.c | |
parent | fa288df453f3748a018f042373908284c559de8c (diff) | |
download | ffmpeg-124ed1c07307c28815850d0dc666d12547afc015.tar.gz |
print date in http_log
Originally committed as revision 13863 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ffserver.c b/ffserver.c index 920b32811d..76f0f8a961 100644 --- a/ffserver.c +++ b/ffserver.c @@ -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(¤t), 31); + buffer[strlen(buffer)-1] = 0; // remove '\n' + fprintf(logfile, "%s ", buffer); + } + print_prefix = strstr(fmt, "\n") != NULL; vfprintf(logfile, fmt, ap); fflush(logfile); } |