You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
478 B

  1. package log
  2. type nopLogger struct{}
  3. // Interface assertions
  4. var _ Logger = (*nopLogger)(nil)
  5. // NewNopLogger returns a logger that doesn't do anything.
  6. func NewNopLogger() Logger { return &nopLogger{} }
  7. func (nopLogger) Info(string, ...interface{}) error {
  8. return nil
  9. }
  10. func (nopLogger) Debug(string, ...interface{}) error {
  11. return nil
  12. }
  13. func (nopLogger) Error(string, ...interface{}) error {
  14. return nil
  15. }
  16. func (l *nopLogger) With(...interface{}) Logger {
  17. return l
  18. }