projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa288df
)
print date in http_log
author
Baptiste Coudurier
<baptiste.coudurier@gmail.com>
Sun, 22 Jun 2008 01:08:48 +0000
(
01:08
+0000)
committer
Baptiste Coudurier
<baptiste.coudurier@gmail.com>
Sun, 22 Jun 2008 01:08:48 +0000
(
01:08
+0000)
Originally committed as revision 13863 to svn://svn.ffmpeg.org/ffmpeg/trunk
ffserver.c
patch
|
blob
|
history
diff --git
a/ffserver.c
b/ffserver.c
index
920b328
..
76f0f8a
100644
(file)
--- 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);
}