Skip to content

Commit

Permalink
*: Hide timestamp by default
Browse files Browse the repository at this point in the history
Closes #47.

Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
  • Loading branch information
smallhive committed Sep 10, 2024
1 parent 1ae9708 commit 001ac60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/neofs-oauthz/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/spf13/pflag"
"github.com/spf13/viper"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/term"
)

const (
Expand Down Expand Up @@ -141,6 +143,12 @@ func newLogger(v *viper.Viper) (*zap.Logger, error) {
}
}

if term.IsTerminal(int(os.Stdout.Fd())) {
c.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
} else {
c.EncoderConfig.EncodeTime = func(t time.Time, encoder zapcore.PrimitiveArrayEncoder) {}

Check warning on line 149 in cmd/neofs-oauthz/config.go

View workflow job for this annotation

GitHub Actions / Lint

unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
}

return c.Build()
}

Expand Down

0 comments on commit 001ac60

Please sign in to comment.