mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
timestamp in log lines
This commit is contained in:
parent
7407797596
commit
1904ecc165
7
redis.c
7
redis.c
@ -556,7 +556,12 @@ void redisLog(int level, const char *fmt, ...)
|
|||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
if (level >= server.verbosity) {
|
if (level >= server.verbosity) {
|
||||||
char *c = ".-*";
|
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);
|
vfprintf(fp, fmt, ap);
|
||||||
fprintf(fp,"\n");
|
fprintf(fp,"\n");
|
||||||
fflush(fp);
|
fflush(fp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user