File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ high performance container runtime
4848`
4949
5050func init () {
51+ logrus .SetFormatter (& logrus.TextFormatter {
52+ TimestampFormat : log .RFC3339NanoFixed ,
53+ FullTimestamp : true ,
54+ })
55+
5156 // Discard grpc logs so that they don't mess with our stdio
5257 grpclog .SetLoggerV2 (grpclog .NewLoggerV2 (ioutil .Discard , ioutil .Discard , ioutil .Discard ))
5358
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ type (
4242// and is usually used to trace detailed behavior of the program.
4343const TraceLevel = logrus .Level (uint32 (logrus .DebugLevel + 1 ))
4444
45+ // RFC3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to
46+ // ensure the formatted time is always the same number of characters.
47+ const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00"
48+
4549// ParseLevel takes a string level and returns the Logrus log level constant.
4650// It supports trace level.
4751func ParseLevel (lvl string ) (logrus.Level , error ) {
You can’t perform that action at this time.
0 commit comments