projects
/
pgbouncer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac4ab0f
)
add milliseconds to log timestamps
author
Marko Kreen
<markokr@gmail.com>
Wed, 19 Nov 2008 12:10:50 +0000
(12:10 +0000)
committer
Marko Kreen
<markokr@gmail.com>
Wed, 19 Nov 2008 12:10:50 +0000
(12:10 +0000)
src/util.c
patch
|
blob
|
blame
|
history
diff --git
a/src/util.c
b/src/util.c
index 937879dc145f0e178007520f0f3cd5ce03014440..0ba6e56d75682fc4b9d7a8b063c462ab893fe400 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-67,7
+67,10
@@
static void render_time(char *buf, int max)
struct timeval tv;
gettimeofday(&tv, NULL);
localtime_r(&tv.tv_sec, &tm);
- strftime(buf, max, "%Y-%m-%d %H:%M:%S", &tm);
+ snprintf(buf, max, "%04d-%02d-%02d %02d:%02d:%02d.%03d",
+ tm.tm_year, tm.tm_mon, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec,
+ (int)(tv.tv_usec / 1000));
}
static void close_syslog(void)