File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed
influx_inspect/verify/seriesfile Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,9 @@ func (cmd *Command) Run(args ...string) error {
5555 }
5656
5757 config := logger .NewConfig ()
58- config .Level = zapcore .WarnLevel
58+ config .Level . SetLevel ( zapcore .WarnLevel )
5959 if cmd .verbose {
60- config .Level = zapcore .InfoLevel
60+ config .Level . SetLevel ( zapcore .InfoLevel )
6161 }
6262 logger , err := config .New (cmd .Stderr )
6363 if err != nil {
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ func (cmd *Command) Run(args []string) (err error) {
5959
6060 var log = zap .NewNop ()
6161 if cmd .verbose {
62- cfg := logger.Config {Format : "logfmt" , Level : zapcore .DebugLevel }
62+ cfg := logger.Config {Format : "logfmt" , Level : zap . NewAtomicLevelAt ( zapcore .DebugLevel ) }
6363 log , err = cfg .New (os .Stdout )
6464 if err != nil {
6565 return err
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ min-version = "tls1.0"
228228 t .Fatalf ("unexpected cache max memory size: %v" , c .Data .CacheMaxMemorySize )
229229 }
230230
231- if c .Logging .Level != zapcore .WarnLevel {
231+ if c .Logging .Level . Level () != zapcore .WarnLevel {
232232 t .Fatalf ("unexpected logging level: %v" , c .Logging .Level )
233233 }
234234
Original file line number Diff line number Diff line change 11package logger
22
33import (
4- "go.uber.org/zap/zapcore "
4+ "go.uber.org/zap"
55)
66
77// Config represents the configuration for creating a zap.Logger.
88type Config struct {
9- Format string `toml:"format"`
10- Level zapcore. Level `toml:"level"`
11- SuppressLogo bool `toml:"suppress-logo"`
9+ Format string `toml:"format"`
10+ Level zap. AtomicLevel `toml:"level"`
11+ SuppressLogo bool `toml:"suppress-logo"`
1212}
1313
1414// NewConfig returns a new instance of Config with defaults.
1515func NewConfig () Config {
1616 return Config {
1717 Format : "auto" ,
18- Level : zapcore . InfoLevel ,
18+ Level : zap . NewAtomicLevel () ,
1919 }
2020}
Original file line number Diff line number Diff line change @@ -141,10 +141,10 @@ func TestGroup_UnmarshalTOML(t *testing.T) {
141141}
142142
143143func TestConfig_Encode (t * testing.T ) {
144- var c run.Config
144+ var c * run.Config = run . NewConfig ()
145145 c .Coordinator .WriteTimeout = itoml .Duration (time .Minute )
146146 buf := new (bytes.Buffer )
147- if err := toml .NewEncoder (buf ).Encode (& c ); err != nil {
147+ if err := toml .NewEncoder (buf ).Encode (c ); err != nil {
148148 t .Fatal ("Failed to encode: " , err )
149149 }
150150 got , search := buf .String (), `write-timeout = "1m0s"`
You can’t perform that action at this time.
0 commit comments