diff options
author | 2018-11-13 23:22:32 +0000 | |
---|---|---|
committer | 2018-11-13 23:22:32 +0000 | |
commit | 944c3e6a946643194c5003c88ccf6de2ee7b67ba (patch) | |
tree | 8a2289005a81c8ed316354a05c1ae8b9ef4220d8 /plugin | |
parent | bb0b60ec812d33f9971e12971ca999f76dd87d52 (diff) | |
download | coredns-944c3e6a946643194c5003c88ccf6de2ee7b67ba.tar.gz coredns-944c3e6a946643194c5003c88ccf6de2ee7b67ba.tar.zst coredns-944c3e6a946643194c5003c88ccf6de2ee7b67ba.zip |
pkg/log: use 000 instead of 999 for the millis (#2303)
999 chops of suffix zero, 000 allows for the milliseconds to be always
printed with 3 chars. This makes the log the printed with the same
columns.
(partial logs below)
2018-11-13T21:13:28.249Z [INFO] [::1]
2018-11-13T21:13:48.414Z [INFO] [::1]
2018-11-13T21:13:49.1Z [INFO] [::1]
vs:
2018-11-13T21:20:22.262Z [INFO] [::1]
2018-11-13T21:20:22.436Z [INFO] [::1]
2018-11-13T21:20:22.608Z [INFO] [::1]
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/pkg/log/log.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/pkg/log/log.go b/plugin/pkg/log/log.go index 2c8971e1d..b4bd1cad8 100644 --- a/plugin/pkg/log/log.go +++ b/plugin/pkg/log/log.go @@ -20,7 +20,7 @@ import ( var D bool // RFC3339Milli doesn't exist, invent it here. -func clock() string { return time.Now().Format("2006-01-02T15:04:05.999Z07:00") } +func clock() string { return time.Now().Format("2006-01-02T15:04:05.000Z07:00") } // logf calls log.Printf prefixed with level. func logf(level, format string, v ...interface{}) { |