github.com/newrelic/newrelic-client-go@v1.1.0/pkg/logging/mock_logger.go (about)

     1  package logging
     2  
     3  import "testing"
     4  
     5  type MockLogger struct {
     6  	t *testing.T
     7  }
     8  
     9  func NewMockLogger(t *testing.T) *MockLogger {
    10  	return &MockLogger{t: t}
    11  }
    12  
    13  // Error logs an error message.
    14  func (l MockLogger) Error(msg string, fields ...interface{}) {
    15  	l.t.Errorf(msg, fields...)
    16  }
    17  
    18  // Warn logs an warning message.
    19  func (l MockLogger) Warn(msg string, fields ...interface{}) {
    20  	l.t.Logf(msg, fields...)
    21  }
    22  
    23  // Info logs an info message.
    24  func (l MockLogger) Info(msg string, fields ...interface{}) {
    25  	l.t.Logf(msg, fields...)
    26  }
    27  
    28  // Debug logs a debug message.
    29  func (l MockLogger) Debug(msg string, fields ...interface{}) {
    30  }
    31  
    32  // Trace logs a trace message.
    33  func (l MockLogger) Trace(msg string, fields ...interface{}) {
    34  }
    35  
    36  func (l MockLogger) SetLevel(logLevel string) {
    37  }