From 447bc325b9797bbf3c78b950565c0e708e035316 Mon Sep 17 00:00:00 2001 From: Janos Miko Date: Thu, 14 Jul 2022 08:50:28 +0200 Subject: [PATCH] disable timestamps in regular logging, enable full timestamp logging in debug mode --- cmd/root.go | 3 ++- go.mod | 1 + go.sum | 2 ++ internal/commands/install.go | 3 --- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index de244f46..131c54df 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -165,7 +165,8 @@ func setLogLevel() { DisableColors: viper.GetBool("disable_colors"), ForceColors: true, DisableLevelTruncation: true, - FullTimestamp: viper.GetBool("full_timestamp"), + FullTimestamp: true, + DisableTimestamp: !viper.GetBool("debug"), QuoteEmptyFields: true, CallerPrettyfier: func(f *runtime.Frame) (string, string) { filename := strings.ReplaceAll(path.Base(f.File), "github.com/rewardenv/reward/", "") diff --git a/go.mod b/go.mod index 379eafd5..1530aab3 100644 --- a/go.mod +++ b/go.mod @@ -31,6 +31,7 @@ require ( github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect github.com/gogo/protobuf v1.2.1 // indirect github.com/golang/protobuf v1.3.4 // indirect github.com/google/go-cmp v0.5.4 // indirect diff --git a/go.sum b/go.sum index b2ba5a22..23f5383c 100644 --- a/go.sum +++ b/go.sum @@ -65,6 +65,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE= +github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= diff --git a/internal/commands/install.go b/internal/commands/install.go index a4f60dcd..f1f02943 100644 --- a/internal/commands/install.go +++ b/internal/commands/install.go @@ -21,9 +21,6 @@ const defaultConfig = `--- # Logging level, can be: trace, debug, info, warn, error log_level: info -# Enable or disable full timestamps in the command command output -full_timestamp: false - # Enable debugging (set log level to debug). Can be used as environment variable too. # eg: DEBUG=true reward env up debug: false