Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nop logger
Browse files Browse the repository at this point in the history
frozenbonito committed Apr 7, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 40d9024 commit 8ac6c33
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
@@ -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 {

0 comments on commit 8ac6c33

Please sign in to comment.