Documentation ¶
Index ¶
- Constants
- Variables
- type DefaultHandler
- type Formatter
- type Handler
- type Level
- type LevelVar
- type LogfmtFormatter
- type LogfmtFormatterOptions
- type Logger
- func (l *Logger) AddHandler(h Handler)
- func (l *Logger) Debug(msg string, kvs ...kv.KeyValue)
- func (l *Logger) Error(msg string, kvs ...kv.KeyValue)
- func (l *Logger) FormatAndWrite(level Level, msg string, kvs ...kv.KeyValue)
- func (l *Logger) Info(msg string, kvs ...kv.KeyValue)
- func (l *Logger) Level() Level
- func (l *Logger) Log(level Level, msg string, kvs ...kv.KeyValue)
- func (l *Logger) LogArgs(level Level, msg string, args ...any)
- func (l *Logger) New(id, name string) *Logger
- func (l *Logger) Notice(msg string, kvs ...kv.KeyValue)
- func (l *Logger) RemoveHandler(name string)
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) Trace(msg string, kvs ...kv.KeyValue)
- func (l *Logger) Warning(msg string, kvs ...kv.KeyValue)
- func (l *Logger) With(kvs ...kv.KeyValue) *Logger
- type Record
Constants ¶
View Source
const ( LogfmtTimestampLayout = "2006-01-02 15:04:05.000" LogfmtMaxLenLoggerID = 8 LogfmtMaxLenLoggerName = 10 )
Variables ¶
View Source
var ( ConsoleHandler = NewDefaultHandler( "__consoleHandler", LevelTrace, NewLogfmtFormatter(&LogfmtFormatterOptions{WithColors: true}), os.Stdout, ) )
Functions ¶
This section is empty.
Types ¶
type DefaultHandler ¶
type DefaultHandler struct {
// contains filtered or unexported fields
}
func NewDefaultHandler ¶
func (*DefaultHandler) Enabled ¶
func (h *DefaultHandler) Enabled(level Level) bool
func (*DefaultHandler) Formatter ¶
func (h *DefaultHandler) Formatter() Formatter
func (*DefaultHandler) Level ¶
func (h *DefaultHandler) Level() Level
func (*DefaultHandler) Name ¶
func (h *DefaultHandler) Name() string
func (*DefaultHandler) SetLevel ¶
func (h *DefaultHandler) SetLevel(level Level)
func (*DefaultHandler) Writer ¶
func (h *DefaultHandler) Writer() io.Writer
type LogfmtFormatter ¶
type LogfmtFormatter struct {
// contains filtered or unexported fields
}
func NewLogfmtFormatter ¶
func NewLogfmtFormatter(opts *LogfmtFormatterOptions) *LogfmtFormatter
type LogfmtFormatterOptions ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) AddHandler ¶
func (*Logger) FormatAndWrite ¶
func (*Logger) RemoveHandler ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.