github.com/ethersphere/bee/v2@v2.2.0/pkg/log/noop_logger.go (about) 1 // Copyright 2022 The Swarm Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package log 6 7 // Noop is an implementation of a logger that does not log. 8 var Noop Logger = new(noopLogger) 9 10 type noopLogger struct{} 11 12 func (nl *noopLogger) V(_ uint) Builder { return nl } 13 func (nl *noopLogger) WithName(_ string) Builder { return nl } 14 func (nl *noopLogger) WithValues(_ ...interface{}) Builder { return nl } 15 func (nl *noopLogger) Build() Logger { return nl } 16 func (nl *noopLogger) Register() Logger { return nl } 17 18 func (nl *noopLogger) Verbosity() Level { return VerbosityNone } 19 func (nl *noopLogger) Debug(_ string, _ ...interface{}) {} 20 func (nl *noopLogger) Info(_ string, _ ...interface{}) {} 21 func (nl *noopLogger) Warning(_ string, _ ...interface{}) {} 22 func (nl *noopLogger) Error(_ error, _ string, _ ...interface{}) {}