Skip to content

Commit

Permalink
Merge pull request #22 from ViaQ/singleton-default-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
periklis authored Mar 29, 2022
2 parents 74d102f + 60c6b10 commit 81c1ed0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ var (
ErrUnknownSinkType = kverrors.New("unknown log sink type")

defaultOutput = os.Stdout

defaultLogger = logr.New(NewLogSink("", defaultOutput, 0, JSONEncoder{}))
)

// DefaultLogger creates a logger without any key value pairs
func DefaultLogger() logr.Logger {
return logr.New(NewLogSink("", defaultOutput, 0, JSONEncoder{}))
return defaultLogger
}

// NewLogger creates a logger with the provided key value pairs
Expand Down

0 comments on commit 81c1ed0

Please sign in to comment.