Documentation
¶
Overview ¶
Package log implements interfaces and helpers for logging.
Index ¶
- Variables
- func Debug(lable Loggable, msg string, pairs ...interface{})
- func Error(lable Loggable, msg string, pairs ...interface{})
- func Fatal(lable Loggable, msg interface{}, pairs ...interface{})
- func Info(lable Loggable, msg string, pairs ...interface{})
- type Loggable
- type Logger
- type MockLoggable
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// Null is the null Logger instance.
Null = &nullLogger{}
)
Functions ¶
Types ¶
type Loggable ¶
type Loggable interface {
Logger() Logger
}
Loggable represents an object that has a Logger.
type Logger ¶
type Logger interface {
// Debug logs a debug message.
Debug(msg string, ctx ...interface{})
// Info logs an informational message.
Info(msg string, ctx ...interface{})
// Error logs an error message.
Error(msg string, ctx ...interface{})
}
Logger represents an abstract logging object.
type MockLoggable ¶
type MockLoggable struct {
// contains filtered or unexported fields
}
MockLoggable implements the Loggable interface.
func NewMockLoggable ¶
func NewMockLoggable(l Logger) *MockLoggable
NewMockLoggable creates a new MockLoggable.
func (*MockLoggable) Logger ¶
func (m *MockLoggable) Logger() Logger
Logger implements the Loggable interface.
Click to show internal directories.
Click to hide internal directories.