Documentation ¶
Overview ¶
Package mlog is a generated GoMock package.
Index ¶
- type GoLogger
- func (l *GoLogger) Debug(args ...any)
- func (l *GoLogger) Debugf(format string, args ...any)
- func (l *GoLogger) Debugln(args ...any)
- func (l *GoLogger) Error(args ...any)
- func (l *GoLogger) Errorf(format string, args ...any)
- func (l *GoLogger) Errorln(args ...any)
- func (l *GoLogger) Fatal(args ...any)
- func (l *GoLogger) Fatalf(format string, args ...any)
- func (l *GoLogger) Fatalln(args ...any)
- func (l *GoLogger) Info(args ...any)
- func (l *GoLogger) Infof(format string, args ...any)
- func (l *GoLogger) Infoln(args ...any)
- func (l *GoLogger) IsLevelEnabled(level LogLevel) bool
- func (l *GoLogger) Sync() error
- func (l *GoLogger) Warn(args ...any)
- func (l *GoLogger) Warnf(format string, args ...any)
- func (l *GoLogger) Warnln(args ...any)
- func (l *GoLogger) WithDefaultMessageTemplate(message string) Logger
- func (l *GoLogger) WithFields(fields ...any) Logger
- type LogLevel
- type Logger
- type MockLogger
- func (m *MockLogger) Debug(args ...any)
- func (m *MockLogger) Debugf(format string, args ...any)
- func (m *MockLogger) Debugln(args ...any)
- func (m *MockLogger) EXPECT() *MockLoggerMockRecorder
- func (m *MockLogger) Error(args ...any)
- func (m *MockLogger) Errorf(format string, args ...any)
- func (m *MockLogger) Errorln(args ...any)
- func (m *MockLogger) Fatal(args ...any)
- func (m *MockLogger) Fatalf(format string, args ...any)
- func (m *MockLogger) Fatalln(args ...any)
- func (m *MockLogger) Info(args ...any)
- func (m *MockLogger) Infof(format string, args ...any)
- func (m *MockLogger) Infoln(args ...any)
- func (m *MockLogger) Sync() error
- func (m *MockLogger) Warn(args ...any)
- func (m *MockLogger) Warnf(format string, args ...any)
- func (m *MockLogger) Warnln(args ...any)
- func (m *MockLogger) WithDefaultMessageTemplate(message string) Logger
- func (m *MockLogger) WithFields(fields ...any) Logger
- type MockLoggerMockRecorder
- func (mr *MockLoggerMockRecorder) Debug(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Debugf(format any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Debugln(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Error(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Errorf(format any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Errorln(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Fatal(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Fatalf(format any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Fatalln(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Info(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Infof(format any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Infoln(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Sync() *gomock.Call
- func (mr *MockLoggerMockRecorder) Warn(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Warnf(format any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Warnln(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) WithDefaultMessageTemplate(message any) *gomock.Call
- func (mr *MockLoggerMockRecorder) WithFields(fields ...any) *gomock.Call
- type NoneLogger
- func (l *NoneLogger) Debug(args ...any)
- func (l *NoneLogger) Debugf(format string, args ...any)
- func (l *NoneLogger) Debugln(args ...any)
- func (l *NoneLogger) Error(args ...any)
- func (l *NoneLogger) Errorf(format string, args ...any)
- func (l *NoneLogger) Errorln(args ...any)
- func (l *NoneLogger) Fatal(args ...any)
- func (l *NoneLogger) Fatalf(format string, args ...any)
- func (l *NoneLogger) Fatalln(args ...any)
- func (l *NoneLogger) Info(args ...any)
- func (l *NoneLogger) Infof(format string, args ...any)
- func (l *NoneLogger) Infoln(args ...any)
- func (l *NoneLogger) Sync() error
- func (l *NoneLogger) Warn(args ...any)
- func (l *NoneLogger) Warnf(format string, args ...any)
- func (l *NoneLogger) Warnln(args ...any)
- func (l *NoneLogger) WithDefaultMessageTemplate(message string) Logger
- func (l *NoneLogger) WithFields(fields ...any) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoLogger ¶
type GoLogger struct { Level LogLevel // contains filtered or unexported fields }
GoLogger is the Go built-in (log) implementation of Logger interface.
func (*GoLogger) IsLevelEnabled ¶
IsLevelEnabled checks if the given level is enabled.
func (*GoLogger) WithDefaultMessageTemplate ¶
func (*GoLogger) WithFields ¶
WithFields implements WithFields Logger interface function
type LogLevel ¶
type LogLevel int8
LogLevel represents the level of log system (fatal, error, warn, info and debug).
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel LogLevel = iota // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel )
These are the different log levels. You can set the logging level to log.
func ParseLevel ¶
ParseLevel takes a string level and returns a LogLevel constant.
type Logger ¶
type Logger interface { Info(args ...any) Infof(format string, args ...any) Infoln(args ...any) Error(args ...any) Errorf(format string, args ...any) Errorln(args ...any) Warn(args ...any) Warnf(format string, args ...any) Warnln(args ...any) Debug(args ...any) Debugf(format string, args ...any) Debugln(args ...any) Fatal(args ...any) Fatalf(format string, args ...any) Fatalln(args ...any) WithFields(fields ...any) Logger WithDefaultMessageTemplate(message string) Logger Sync() error }
Logger is the pkg interface for log implementation.
type MockLogger ¶ added in v1.31.0
type MockLogger struct {
// contains filtered or unexported fields
}
MockLogger is a mock of Logger interface.
func NewMockLogger ¶ added in v1.31.0
func NewMockLogger(ctrl *gomock.Controller) *MockLogger
NewMockLogger creates a new mock instance.
func (*MockLogger) Debug ¶ added in v1.31.0
func (m *MockLogger) Debug(args ...any)
Debug mocks base method.
func (*MockLogger) Debugf ¶ added in v1.31.0
func (m *MockLogger) Debugf(format string, args ...any)
Debugf mocks base method.
func (*MockLogger) Debugln ¶ added in v1.31.0
func (m *MockLogger) Debugln(args ...any)
Debugln mocks base method.
func (*MockLogger) EXPECT ¶ added in v1.31.0
func (m *MockLogger) EXPECT() *MockLoggerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLogger) Error ¶ added in v1.31.0
func (m *MockLogger) Error(args ...any)
Error mocks base method.
func (*MockLogger) Errorf ¶ added in v1.31.0
func (m *MockLogger) Errorf(format string, args ...any)
Errorf mocks base method.
func (*MockLogger) Errorln ¶ added in v1.31.0
func (m *MockLogger) Errorln(args ...any)
Errorln mocks base method.
func (*MockLogger) Fatal ¶ added in v1.31.0
func (m *MockLogger) Fatal(args ...any)
Fatal mocks base method.
func (*MockLogger) Fatalf ¶ added in v1.31.0
func (m *MockLogger) Fatalf(format string, args ...any)
Fatalf mocks base method.
func (*MockLogger) Fatalln ¶ added in v1.31.0
func (m *MockLogger) Fatalln(args ...any)
Fatalln mocks base method.
func (*MockLogger) Info ¶ added in v1.31.0
func (m *MockLogger) Info(args ...any)
Info mocks base method.
func (*MockLogger) Infof ¶ added in v1.31.0
func (m *MockLogger) Infof(format string, args ...any)
Infof mocks base method.
func (*MockLogger) Infoln ¶ added in v1.31.0
func (m *MockLogger) Infoln(args ...any)
Infoln mocks base method.
func (*MockLogger) Sync ¶ added in v1.31.0
func (m *MockLogger) Sync() error
Sync mocks base method.
func (*MockLogger) Warn ¶ added in v1.31.0
func (m *MockLogger) Warn(args ...any)
Warn mocks base method.
func (*MockLogger) Warnf ¶ added in v1.31.0
func (m *MockLogger) Warnf(format string, args ...any)
Warnf mocks base method.
func (*MockLogger) Warnln ¶ added in v1.31.0
func (m *MockLogger) Warnln(args ...any)
Warnln mocks base method.
func (*MockLogger) WithDefaultMessageTemplate ¶ added in v1.31.0
func (m *MockLogger) WithDefaultMessageTemplate(message string) Logger
WithDefaultMessageTemplate mocks base method.
func (*MockLogger) WithFields ¶ added in v1.31.0
func (m *MockLogger) WithFields(fields ...any) Logger
WithFields mocks base method.
type MockLoggerMockRecorder ¶ added in v1.31.0
type MockLoggerMockRecorder struct {
// contains filtered or unexported fields
}
MockLoggerMockRecorder is the mock recorder for MockLogger.
func (*MockLoggerMockRecorder) Debug ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Debug(args ...any) *gomock.Call
Debug indicates an expected call of Debug.
func (*MockLoggerMockRecorder) Debugf ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Debugf(format any, args ...any) *gomock.Call
Debugf indicates an expected call of Debugf.
func (*MockLoggerMockRecorder) Debugln ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Debugln(args ...any) *gomock.Call
Debugln indicates an expected call of Debugln.
func (*MockLoggerMockRecorder) Error ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Error(args ...any) *gomock.Call
Error indicates an expected call of Error.
func (*MockLoggerMockRecorder) Errorf ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Errorf(format any, args ...any) *gomock.Call
Errorf indicates an expected call of Errorf.
func (*MockLoggerMockRecorder) Errorln ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Errorln(args ...any) *gomock.Call
Errorln indicates an expected call of Errorln.
func (*MockLoggerMockRecorder) Fatal ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Fatal(args ...any) *gomock.Call
Fatal indicates an expected call of Fatal.
func (*MockLoggerMockRecorder) Fatalf ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Fatalf(format any, args ...any) *gomock.Call
Fatalf indicates an expected call of Fatalf.
func (*MockLoggerMockRecorder) Fatalln ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Fatalln(args ...any) *gomock.Call
Fatalln indicates an expected call of Fatalln.
func (*MockLoggerMockRecorder) Info ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Info(args ...any) *gomock.Call
Info indicates an expected call of Info.
func (*MockLoggerMockRecorder) Infof ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Infof(format any, args ...any) *gomock.Call
Infof indicates an expected call of Infof.
func (*MockLoggerMockRecorder) Infoln ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Infoln(args ...any) *gomock.Call
Infoln indicates an expected call of Infoln.
func (*MockLoggerMockRecorder) Sync ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Sync() *gomock.Call
Sync indicates an expected call of Sync.
func (*MockLoggerMockRecorder) Warn ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Warn(args ...any) *gomock.Call
Warn indicates an expected call of Warn.
func (*MockLoggerMockRecorder) Warnf ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Warnf(format any, args ...any) *gomock.Call
Warnf indicates an expected call of Warnf.
func (*MockLoggerMockRecorder) Warnln ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) Warnln(args ...any) *gomock.Call
Warnln indicates an expected call of Warnln.
func (*MockLoggerMockRecorder) WithDefaultMessageTemplate ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) WithDefaultMessageTemplate(message any) *gomock.Call
WithDefaultMessageTemplate indicates an expected call of WithDefaultMessageTemplate.
func (*MockLoggerMockRecorder) WithFields ¶ added in v1.31.0
func (mr *MockLoggerMockRecorder) WithFields(fields ...any) *gomock.Call
WithFields indicates an expected call of WithFields.
type NoneLogger ¶
type NoneLogger struct{}
NoneLogger is a wrapper for log nothing.
func (*NoneLogger) Debug ¶
func (l *NoneLogger) Debug(args ...any)
Debug implements Debug Logger interface function.
func (*NoneLogger) Debugf ¶
func (l *NoneLogger) Debugf(format string, args ...any)
Debugf implements Debugf Logger interface function.
func (*NoneLogger) Debugln ¶
func (l *NoneLogger) Debugln(args ...any)
Debugln implements Debugln Logger interface function.
func (*NoneLogger) Error ¶
func (l *NoneLogger) Error(args ...any)
Error implements Error Logger interface function.
func (*NoneLogger) Errorf ¶
func (l *NoneLogger) Errorf(format string, args ...any)
Errorf implements Errorf Logger interface function.
func (*NoneLogger) Errorln ¶
func (l *NoneLogger) Errorln(args ...any)
Errorln implements Errorln Logger interface function.
func (*NoneLogger) Fatal ¶
func (l *NoneLogger) Fatal(args ...any)
Fatal implements Fatal Logger interface function.
func (*NoneLogger) Fatalf ¶
func (l *NoneLogger) Fatalf(format string, args ...any)
Fatalf implements Fatalf Logger interface function.
func (*NoneLogger) Fatalln ¶
func (l *NoneLogger) Fatalln(args ...any)
Fatalln implements Fatalln Logger interface function.
func (*NoneLogger) Info ¶
func (l *NoneLogger) Info(args ...any)
Info implements Info Logger interface function.
func (*NoneLogger) Infof ¶
func (l *NoneLogger) Infof(format string, args ...any)
Infof implements Infof Logger interface function.
func (*NoneLogger) Infoln ¶
func (l *NoneLogger) Infoln(args ...any)
Infoln implements Infoln Logger interface function.
func (*NoneLogger) Sync ¶
func (l *NoneLogger) Sync() error
Sync implements Sync Logger interface function.
func (*NoneLogger) Warn ¶
func (l *NoneLogger) Warn(args ...any)
Warn implements Warn Logger interface function.
func (*NoneLogger) Warnf ¶
func (l *NoneLogger) Warnf(format string, args ...any)
Warnf implements Warnf Logger interface function.
func (*NoneLogger) Warnln ¶
func (l *NoneLogger) Warnln(args ...any)
Warnln implements Warnln Logger interface function.
func (*NoneLogger) WithDefaultMessageTemplate ¶
func (l *NoneLogger) WithDefaultMessageTemplate(message string) Logger
WithDefaultMessageTemplate sets the default message template for the logger.
func (*NoneLogger) WithFields ¶
func (l *NoneLogger) WithFields(fields ...any) Logger
WithFields implements WithFields Logger interface function