Skip to content

Commit

Permalink
Add nop logger
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenbonito committed Apr 8, 2023
1 parent 3c5ea66 commit cd6622e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ type Logger interface {
Print(v ...interface{})
}

// NopLogger is a nop implementation of the Logger interface.
type NopLogger struct{}

// Print implements Logger interface.
func (nl *NopLogger) Print(_ ...interface{}) {}

// SetLogger is used to set the default logger for critical errors.
// The initial logger is os.Stderr.
func SetLogger(logger Logger) error {
Expand Down

0 comments on commit cd6622e

Please sign in to comment.