Documentation
¶
Index ¶
- type TestLogAdaptor
- func (t *TestLogAdaptor) Debug(msg string, fields watermill.LogFields)
- func (t *TestLogAdaptor) Error(msg string, err error, fields watermill.LogFields)
- func (t *TestLogAdaptor) Info(msg string, fields watermill.LogFields)
- func (t *TestLogAdaptor) Trace(msg string, fields watermill.LogFields)
- func (t *TestLogAdaptor) With(fields watermill.LogFields) watermill.LoggerAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestLogAdaptor ¶
type TestLogAdaptor struct {
// UseError will instruct the adaptor to use t.Error when logging fields, causing
// tests to fail if any error were logged. Exposed to allow users to change the value
// during a test.
UseError bool
// LogLevel is uses to determine what we should log and what we should skip. Exposed to allow users to change the value
// during a test.
LogLevel watermill.LogLevel
// contains filtered or unexported fields
}
TestLogAdaptor implements watermill.LoggerAdapter and can be used to capture logs in test code.
func NewTestAdaptor ¶
NewTestAdaptor instantiates a new adaptor that writes logs to the given test instance. If useError is set to true, it will also cause the test to fail.
func (*TestLogAdaptor) Debug ¶
func (t *TestLogAdaptor) Debug(msg string, fields watermill.LogFields)
Debug implements watermill.LoggerAdapter.
func (*TestLogAdaptor) Error ¶
func (t *TestLogAdaptor) Error(msg string, err error, fields watermill.LogFields)
Error implements watermill.LoggerAdapter.
func (*TestLogAdaptor) Info ¶
func (t *TestLogAdaptor) Info(msg string, fields watermill.LogFields)
Info implements watermill.LoggerAdapter.
func (*TestLogAdaptor) Trace ¶
func (t *TestLogAdaptor) Trace(msg string, fields watermill.LogFields)
Trace implements watermill.LoggerAdapter.
func (*TestLogAdaptor) With ¶
func (t *TestLogAdaptor) With(fields watermill.LogFields) watermill.LoggerAdapter
With implements watermill.LoggerAdapter.
Click to show internal directories.
Click to hide internal directories.