Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogMessage ¶
type TestLogger ¶
func New ¶
func New() *TestLogger
New returns a logger with an in memory buffer containing log messages for use in tests The logger will write to stdout and the buffer, if you want to hide the log output use HideLogOutput
func (*TestLogger) GetErrorMessages ¶
func (l *TestLogger) GetErrorMessages() ([]LogMessage, error)
GetErrorMessages returns all log messages with error, fatal and panic level If you only want a single of those levels, use GetMessagesForLevel instead
func (*TestLogger) GetLogMessages ¶
func (l *TestLogger) GetLogMessages() ([]LogMessage, error)
func (*TestLogger) GetMessagesForLevel ¶
func (l *TestLogger) GetMessagesForLevel(level logger.Level) ([]LogMessage, error)
func (*TestLogger) HideLogOutput ¶ added in v0.65.0
func (l *TestLogger) HideLogOutput() *TestLogger
HideLogOutput hides the log output from stdout and only logs to the in-memory buffer
Click to show internal directories.
Click to hide internal directories.