fix: console ts with json number (#115)
This commit is contained in:
parent
8e30c71369
commit
7bcaa1a99e
|
@ -292,13 +292,16 @@ func colorize(s interface{}, c int, disabled bool) string {
|
|||
var (
|
||||
consoleDefaultFormatTimestamp = func(i interface{}) string {
|
||||
t := "<nil>"
|
||||
if tt, ok := i.(string); ok {
|
||||
switch tt := i.(type) {
|
||||
case string:
|
||||
ts, err := time.Parse(time.RFC3339, tt)
|
||||
if err != nil {
|
||||
t = tt
|
||||
} else {
|
||||
t = ts.Format(consoleTimeFormat)
|
||||
}
|
||||
case json.Number:
|
||||
t = tt.String()
|
||||
}
|
||||
return colorize(t, colorFaint, consoleNoColor)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue