Skip to content

Commit

Permalink
fix var name typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nader-ziada committed Jan 16, 2021
1 parent 3c5b358 commit 214c228
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions pkg/log/zap/zap.go
Expand Up @@ -56,10 +56,10 @@ func UseDevMode(enabled bool) Opts {
}

// WriteTo configures the logger to write to the given io.Writer, instead of standard error.
// See Options.DestWritter
// See Options.DestWriter
func WriteTo(out io.Writer) Opts {
return func(o *Options) {
o.DestWritter = out
o.DestWriter = out
}
}

Expand Down Expand Up @@ -143,9 +143,9 @@ type Options struct {
// NewEncoder configures Encoder using the provided EncoderConfigOptions.
// Note that the NewEncoder function is not used when the Encoder option is already set.
NewEncoder NewEncoderFunc
// DestWritter controls the destination of the log output. Defaults to
// DestWriter controls the destination of the log output. Defaults to
// os.Stderr.
DestWritter io.Writer
DestWriter io.Writer
// Level configures the verbosity of the logging. Defaults to Debug when
// Development is true and Info otherwise
Level zapcore.LevelEnabler
Expand All @@ -160,8 +160,8 @@ type Options struct {

// addDefaults adds defaults to the Options
func (o *Options) addDefaults() {
if o.DestWritter == nil {
o.DestWritter = os.Stderr
if o.DestWriter == nil {
o.DestWriter = os.Stderr
}

if o.Development {
Expand Down Expand Up @@ -216,7 +216,7 @@ func NewRaw(opts ...Opts) *zap.Logger {
o.addDefaults()

// this basically mimics New<type>Config, but with a custom sink
sink := zapcore.AddSync(o.DestWritter)
sink := zapcore.AddSync(o.DestWriter)

o.ZapOpts = append(o.ZapOpts, zap.AddCallerSkip(1), zap.ErrorOutput(sink))
log := zap.New(zapcore.NewCore(&KubeAwareEncoder{Encoder: o.Encoder, Verbose: o.Development}, sink, o.Level))
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/zap/zap_test.go
Expand Up @@ -137,7 +137,7 @@ var _ = Describe("Zap options setup", func() {
It("should set a custom writer", func() {
var w fakeSyncWriter
WriteTo(&w)(opts)
Expect(opts.DestWritter).To(Equal(&w))
Expect(opts.DestWriter).To(Equal(&w))
})
})

Expand Down

0 comments on commit 214c228

Please sign in to comment.