Documentation
¶
Overview ¶
Package logtest redirects the process-wide logger output for the length of a test, so a test can assert what was logged or keep expected errors out of the test output. The logger output is global: tests using it must not run in parallel with other tests that log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer holds the log entries written while it is installed.
func NewCollector ¶
NewCollector collects every log entry until t ends, then restores the previous output.
Click to show internal directories.
Click to hide internal directories.