Skip to content

Commit

Permalink
[logging] refs fibercrypto#298 - Create Writer for none option
Browse files Browse the repository at this point in the history
Writer that write nothing
  • Loading branch information
AntiD2ta committed Jan 20, 2020
1 parent 8f7bc72 commit 4ded230
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/util/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,12 @@ func SetOutputToFile(dir string) error {
SetOutputTo(f)
return nil
}

// NoWriter is a writer that write nothing, useful when no writing or output is desired.
type NoWriter struct {
io.Writer
}

func (NoWriter) Write(p []byte) (n int, err error) {
return 0, nil
}

0 comments on commit 4ded230

Please sign in to comment.