提交 1904ecc1 编写于 作者: A antirez

timestamp in log lines

上级 74077975
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册