Documentation ¶
Overview ¶
mocklogger/mocklogger.go
Index ¶
- type MockLogger
- func (m *MockLogger) Debug(msg string, fields ...zap.Field)
- func (m *MockLogger) Error(msg string, fields ...zap.Field) error
- func (m *MockLogger) Fatal(msg string, fields ...zap.Field)
- func (m *MockLogger) GetLogLevel() logger.LogLevel
- func (m *MockLogger) Info(msg string, fields ...zap.Field)
- func (m *MockLogger) LogAuthTokenError(event string, method string, url string, statusCode int, err error)
- func (m *MockLogger) LogCookies(direction string, obj interface{}, method, url string)
- func (m *MockLogger) LogError(event string, method string, url string, statusCode int, ...)
- func (m *MockLogger) LogRateLimiting(event string, method string, url string, retryAfter string, ...)
- func (m *MockLogger) LogRequestEnd(event string, method string, url string, statusCode int, ...)
- func (m *MockLogger) LogRequestStart(event string, requestID string, userID string, method string, url string, ...)
- func (m *MockLogger) LogResponse(event string, method string, url string, statusCode int, responseBody string, ...)
- func (m *MockLogger) LogRetryAttempt(event string, method string, url string, attempt int, reason string, ...)
- func (m *MockLogger) Panic(msg string, fields ...zap.Field)
- func (m *MockLogger) SetLevel(level logger.LogLevel)
- func (m *MockLogger) Warn(msg string, fields ...zap.Field)
- func (m *MockLogger) With(fields ...zap.Field) logger.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockLogger ¶
MockLogger is a mock type for the Logger interface, embedding a *zap.Logger to satisfy the type requirement.
func NewMockLogger ¶
func NewMockLogger() *MockLogger
NewMockLogger creates a new instance of MockLogger with an embedded no-op *zap.Logger.
func (*MockLogger) Debug ¶
func (m *MockLogger) Debug(msg string, fields ...zap.Field)
Debug logs a message at the Debug level.
func (*MockLogger) Error ¶
func (m *MockLogger) Error(msg string, fields ...zap.Field) error
Error logs a message at the Error level and returns an error.
func (*MockLogger) Fatal ¶
func (m *MockLogger) Fatal(msg string, fields ...zap.Field)
Fatal logs a message at the Fatal level and then calls os.Exit(1).
func (*MockLogger) GetLogLevel ¶
func (m *MockLogger) GetLogLevel() logger.LogLevel
GetLogLevel mocks the GetLogLevel method of the Logger interface.
func (*MockLogger) Info ¶
func (m *MockLogger) Info(msg string, fields ...zap.Field)
Info logs a message at the Info level.
func (*MockLogger) LogAuthTokenError ¶
func (m *MockLogger) LogAuthTokenError(event string, method string, url string, statusCode int, err error)
Example for LogAuthTokenError:
func (*MockLogger) LogCookies ¶
func (m *MockLogger) LogCookies(direction string, obj interface{}, method, url string)
LogCookies logs information about cookies.
func (*MockLogger) LogError ¶
func (m *MockLogger) LogError(event string, method string, url string, statusCode int, serverStatusMessage string, err error, rawResponse string)
LogError logs an error event.
func (*MockLogger) LogRateLimiting ¶
func (m *MockLogger) LogRateLimiting(event string, method string, url string, retryAfter string, waitDuration time.Duration)
LogRateLimiting logs rate limiting events.
func (*MockLogger) LogRequestEnd ¶
func (m *MockLogger) LogRequestEnd(event string, method string, url string, statusCode int, duration time.Duration)
LogRequestEnd logs the end of an HTTP request.
func (*MockLogger) LogRequestStart ¶
func (m *MockLogger) LogRequestStart(event string, requestID string, userID string, method string, url string, headers map[string][]string)
LogRequestStart logs the start of an HTTP request.
func (*MockLogger) LogResponse ¶
func (m *MockLogger) LogResponse(event string, method string, url string, statusCode int, responseBody string, responseHeaders map[string][]string, duration time.Duration)
LogResponse logs HTTP responses.
func (*MockLogger) LogRetryAttempt ¶
func (m *MockLogger) LogRetryAttempt(event string, method string, url string, attempt int, reason string, waitDuration time.Duration, err error)
LogRetryAttempt logs a retry attempt.
func (*MockLogger) Panic ¶
func (m *MockLogger) Panic(msg string, fields ...zap.Field)
Panic logs a message at the Panic level and then panics.
func (*MockLogger) SetLevel ¶
func (m *MockLogger) SetLevel(level logger.LogLevel)
SetLevel sets the logging level of the MockLogger. This controls the verbosity of the logger, allowing it to filter out logs below the set level.