null.go 399 B

12345678910111213141516171819
  1. package logger
  2. // NullLogger is a logger.Logger and logger.Factory implementation that does nothing.
  3. type NullLogger struct {
  4. }
  5. // Out is a no-op function.
  6. func (n *NullLogger) Out(_ []byte) {
  7. }
  8. // Err is a no-op function.
  9. func (n *NullLogger) Err(_ []byte) {
  10. }
  11. // Create implements logger.Factory and returns a NullLogger.
  12. func (n *NullLogger) Create(_ string) Logger {
  13. return &NullLogger{}
  14. }