Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anvari1313 committed Sep 10, 2024
1 parent c6b878e commit fac7a4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type Config struct {
Level string `json:"level,omitempty" koanf:"level"`
Level string `json:"level,omitempty" koanf:"level"`
Stacktrace bool `json:"stacktrace,omitempty" koanf:"stacktrace"`
}

Expand All @@ -31,9 +31,11 @@ func New(cfg Config) *zap.Logger {
core := zapcore.NewTee(cores...)
var zapOpts = make([]zap.Option, 0, 2)
zapOpts = append(zapOpts, zap.AddCaller())

Check warning on line 33 in internal/logger/logger.go

View check run for this annotation

Codecov / codecov/patch

internal/logger/logger.go#L32-L33

Added lines #L32 - L33 were not covered by tests

if cfg.Stacktrace {
zapOpts = append(zapOpts, zap.AddStacktrace(zap.ErrorLevel))

Check warning on line 36 in internal/logger/logger.go

View check run for this annotation

Codecov / codecov/patch

internal/logger/logger.go#L35-L36

Added lines #L35 - L36 were not covered by tests
}

logger := zap.New(core, zapOpts...)

Check warning on line 39 in internal/logger/logger.go

View check run for this annotation

Codecov / codecov/patch

internal/logger/logger.go#L39

Added line #L39 was not covered by tests

return logger
Expand Down

0 comments on commit fac7a4b

Please sign in to comment.