Documentation ¶
Index ¶
- Variables
- func Logger(logName string) bark.Logger
- func SetLevel(logName string, level Level) error
- func SetLevels(levels map[string]Level) error
- func SetLogger(log bark.Logger)
- type Facility
- func (f *Facility) Log(logName string, wantLevel Level, fields bark.Fields, msg []interface{})
- func (f *Facility) Logf(logName string, wantLevel Level, fields bark.Fields, format string, ...)
- func (f *Facility) Logger(logName string) bark.Logger
- func (f *Facility) SetLevel(logName string, level Level) error
- func (f *Facility) SetLevels(levels map[string]Level) error
- func (f *Facility) SetLogger(log bark.Logger)
- type Level
Constants ¶
This section is empty.
Variables ¶
var NoLogger bark.Logger = noLogger{}
NoLogger is the default logger used by logging facilities when a logger is not passed.
Functions ¶
Types ¶
type Facility ¶
type Facility struct {
// contains filtered or unexported fields
}
Facility is a collection of named loggers that can be configured individually.
func NewFacility ¶
NewFacility creates a new log facility with the specified logger as the underlying logger. If no logger is passed, a no-op implementation is used.
func (*Facility) Log ¶
Log logs messages with a severity level equal to or higher than the one set with SetLevel. If that's not the case, the message is silenced. If the logName was not previously configured with SetLevel, the messages are never silenced. Instead on using this method directly, one can call Logger method to get a bark.Logger instance bound to a specific name.
func (*Facility) Logf ¶
func (f *Facility) Logf(logName string, wantLevel Level, fields bark.Fields, format string, msg []interface{})
Logf is the same as Log but with fmt.Printf-like formatting
func (*Facility) SetLevel ¶
SetLevel sets the minimum severity level for a named logger. All messages produced by a named logger with a severity lower than the one set here are silenced. In most logger implementations, both Fatal and Panic stop the execution. This means that those levels only produce a single, and often important, message. Because of that, it's an error to pass a level above Fatal to this method.
type Level ¶
type Level uint8
Level is the severity level of a log message.