Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StdLogger = New(false)
StdLogger is the logger that is used from the log functions in this package
Functions ¶
func DebugEnabled ¶
func DebugEnabled() bool
DebugEnabled returns true if the Stdlogger logs debug messages
func Debugln ¶
func Debugln(v ...any)
Debugln logs a debug message to stdout. It's only shown if debugging is enabled.
func RedirectToTestingLog ¶
RedirectToTestingLog redirects all log output while a testcase is executed to t.Log. When the testcase finished, the logger output and the debug log level is restored to the previous values.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger logs messages
func New ¶
New returns a new Logger that logs to Stderr. Debug messages are only printed if debugEnabled is true
func (*Logger) DebugEnabled ¶
DebugEnabled returns true if logging debug messages is enabled
func (*Logger) Debugf ¶
Debugf logs a debug message to stdout. It's only shown if debugging is enabled.
func (*Logger) Debugln ¶
Debugln logs a debug message to stdout. It's only shown if debugging is enabled.
func (*Logger) EnableDebug ¶
EnableDebug enables/disables logging debug messages
type TestLogOutput ¶
type TestLogOutput struct {
// contains filtered or unexported fields
}
func NewTestLogOutput ¶
func NewTestLogOutput(t *testing.T) *TestLogOutput
NewTestLogOutput wraps the logger of testing.T to provide the Output interface.
func (*TestLogOutput) Printf ¶
func (l *TestLogOutput) Printf(format string, v ...any)
func (*TestLogOutput) Println ¶
func (l *TestLogOutput) Println(v ...any)