mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
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>
This commit is contained in:
@@ -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{}) {
|
||||
|
||||
Reference in New Issue
Block a user