summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-03-04 13:43:04 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-03-04 13:43:04 -0500
commit29ade7f6af11de5525039212f99d17cd7c9228a3 (patch)
tree0a1a9860bb2e451ed9eaf7f16786beec11731cb0 /pkg
parent9adcda73892fa0a33cbdf971ad97cf079e8e425f (diff)
downloadpodman-29ade7f6af11de5525039212f99d17cd7c9228a3.tar.gz
podman-29ade7f6af11de5525039212f99d17cd7c9228a3.tar.bz2
podman-29ade7f6af11de5525039212f99d17cd7c9228a3.zip
Change timestamp format for podman logs
The Golang standard library implementation of RFC3339Nano will trim trailing 0s from the nanoseconds portion of timestamps. This is undesirable for lining everything up nicely during terminal output. As the Golang developers have not seen fit to give us a better way, use the one that was proposed on the issue tracker but rejected. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/logs/logs.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/logs/logs.go b/pkg/logs/logs.go
index b104c592b..a668e1976 100644
--- a/pkg/logs/logs.go
+++ b/pkg/logs/logs.go
@@ -35,7 +35,10 @@ import (
const (
// timeFormat is the time format used in the log.
- timeFormat = time.RFC3339Nano
+ // It is a modified version of RFC3339Nano that guarantees trailing
+ // zeroes are not trimmed, taken from
+ // https://github.com/golang/go/issues/19635
+ timeFormat = "2006-01-02T15:04:05.000000000Z07:00"
)
// LogStreamType is the type of the stream in CRI container log.