Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Debug(level uint8, v ...interface{})
- func (l *Logger) Debugf(level uint8, format string, v ...interface{})
- func (l *Logger) Debugln(level uint8, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Fatalln(v ...interface{})
- func (l *Logger) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) Panicln(v ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Println(v ...interface{})
- type TestLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func New ¶
func New(logger TestLogger) *Logger
New will create a Logger from a TestLogger. The Logger that is created satisfies the log.DebugLogger interface and thus may be used widely. It serves as an adaptor between the testing.T type from the standard library and library code that expects a generic logging type. Trailing newlines are removed before calling the TestLogger methods.
func (*Logger) Debug ¶
Debug will call the Log method of the underlying TestLogger, regardless of the debug level.
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal will call the Fatal method of the underlying TestLogger.
func (*Logger) Panic ¶
func (l *Logger) Panic(v ...interface{})
Panic will call the Fatal method of the underlying TestLogger and will then call panic.
func (*Logger) Print ¶
func (l *Logger) Print(v ...interface{})
Print will call the Log method of the underlying TestLogger.
type TestLogger ¶
type TestLogger interface { Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) Log(v ...interface{}) Logf(format string, v ...interface{}) }
TestLogger defines an interface for a type that can be used for logging by tests. The testing.T type from the standard library satisfies this interface.