Documentation
¶
Index ¶
- Constants
- Variables
- type BlockOptions
- type Level
- type LogboekLogger
- func (l *LogboekLogger) AcceptLevel(ctx context.Context, lvl Level) bool
- func (l *LogboekLogger) BlockContentWidth(ctx context.Context) int
- func (l *LogboekLogger) Debug(ctx context.Context, format string, a ...interface{})
- func (l *LogboekLogger) DebugPop(ctx context.Context, group string)
- func (l *LogboekLogger) DebugPush(ctx context.Context, group, format string, a ...interface{})
- func (l *LogboekLogger) Error(ctx context.Context, format string, a ...interface{})
- func (l *LogboekLogger) ErrorPop(ctx context.Context, group string)
- func (l *LogboekLogger) ErrorPush(ctx context.Context, group, format string, a ...interface{})
- func (l *LogboekLogger) Info(ctx context.Context, format string, a ...interface{})
- func (l *LogboekLogger) InfoBlock(ctx context.Context, opts BlockOptions, fn func())
- func (l *LogboekLogger) InfoBlockErr(ctx context.Context, opts BlockOptions, fn func() error) error
- func (l *LogboekLogger) InfoPop(ctx context.Context, group string)
- func (l *LogboekLogger) InfoPush(ctx context.Context, group, format string, a ...interface{})
- func (l *LogboekLogger) Level(context.Context) Level
- func (l *LogboekLogger) SetLevel(ctx context.Context, lvl Level)
- func (l *LogboekLogger) Trace(ctx context.Context, format string, a ...interface{})
- func (l *LogboekLogger) TracePop(ctx context.Context, group string)
- func (l *LogboekLogger) TracePush(ctx context.Context, group, format string, a ...interface{})
- func (l *LogboekLogger) TraceStruct(ctx context.Context, obj interface{}, format string, a ...interface{})
- func (l *LogboekLogger) Warn(ctx context.Context, format string, a ...interface{})
- func (l *LogboekLogger) WarnPop(ctx context.Context, group string)
- func (l *LogboekLogger) WarnPush(ctx context.Context, group, format string, a ...interface{})
- type Logger
- type NullLogger
- func (l *NullLogger) AcceptLevel(ctx context.Context, lvl Level) bool
- func (l *NullLogger) BlockContentWidth(ctx context.Context) int
- func (l *NullLogger) Debug(ctx context.Context, format string, a ...interface{})
- func (l *NullLogger) DebugPop(ctx context.Context, group string)
- func (l *NullLogger) DebugPush(ctx context.Context, group, format string, a ...interface{})
- func (l *NullLogger) Error(ctx context.Context, format string, a ...interface{})
- func (l *NullLogger) ErrorPop(ctx context.Context, group string)
- func (l *NullLogger) ErrorPush(ctx context.Context, group, format string, a ...interface{})
- func (l *NullLogger) Info(ctx context.Context, format string, a ...interface{})
- func (l *NullLogger) InfoBlock(ctx context.Context, opts BlockOptions, fn func())
- func (l *NullLogger) InfoBlockErr(ctx context.Context, opts BlockOptions, fn func() error) error
- func (l *NullLogger) InfoPop(ctx context.Context, group string)
- func (l *NullLogger) InfoPush(ctx context.Context, group, format string, a ...interface{})
- func (l *NullLogger) Level(context.Context) Level
- func (l *NullLogger) SetLevel(ctx context.Context, lvl Level)
- func (l *NullLogger) Trace(ctx context.Context, format string, a ...interface{})
- func (l *NullLogger) TracePop(ctx context.Context, group string)
- func (l *NullLogger) TracePush(ctx context.Context, group, format string, a ...interface{})
- func (l *NullLogger) TraceStruct(ctx context.Context, obj interface{}, format string, a ...interface{})
- func (l *NullLogger) Warn(ctx context.Context, format string, a ...interface{})
- func (l *NullLogger) WarnPop(ctx context.Context, group string)
- func (l *NullLogger) WarnPush(ctx context.Context, group, format string, a ...interface{})
Constants ¶
View Source
const LogboekLoggerCtxKeyName = "logboek_logger"
Variables ¶
View Source
var ( Default Logger = DefaultLogboek DefaultLogboek = NewLogboekLogger() DefaultNull = NewNullLogger() )
View Source
var Levels = []Level{SilentLevel, ErrorLevel, WarningLevel, InfoLevel, DebugLevel, TraceLevel}
Functions ¶
This section is empty.
Types ¶
type BlockOptions ¶ added in v1.4.1
type BlockOptions struct {
BlockTitle string
}
type LogboekLogger ¶
type LogboekLogger struct {
// contains filtered or unexported fields
}
func NewLogboekLogger ¶
func NewLogboekLogger() *LogboekLogger
func (*LogboekLogger) AcceptLevel ¶
func (l *LogboekLogger) AcceptLevel(ctx context.Context, lvl Level) bool
func (*LogboekLogger) BlockContentWidth ¶ added in v1.9.0
func (l *LogboekLogger) BlockContentWidth(ctx context.Context) int
func (*LogboekLogger) Debug ¶
func (l *LogboekLogger) Debug(ctx context.Context, format string, a ...interface{})
func (*LogboekLogger) DebugPop ¶
func (l *LogboekLogger) DebugPop(ctx context.Context, group string)
func (*LogboekLogger) DebugPush ¶
func (l *LogboekLogger) DebugPush(ctx context.Context, group, format string, a ...interface{})
func (*LogboekLogger) Error ¶
func (l *LogboekLogger) Error(ctx context.Context, format string, a ...interface{})
func (*LogboekLogger) ErrorPop ¶
func (l *LogboekLogger) ErrorPop(ctx context.Context, group string)
func (*LogboekLogger) ErrorPush ¶
func (l *LogboekLogger) ErrorPush(ctx context.Context, group, format string, a ...interface{})
func (*LogboekLogger) Info ¶
func (l *LogboekLogger) Info(ctx context.Context, format string, a ...interface{})
func (*LogboekLogger) InfoBlock ¶
func (l *LogboekLogger) InfoBlock(ctx context.Context, opts BlockOptions, fn func())
func (*LogboekLogger) InfoBlockErr ¶ added in v1.5.0
func (l *LogboekLogger) InfoBlockErr(ctx context.Context, opts BlockOptions, fn func() error) error
func (*LogboekLogger) InfoPush ¶
func (l *LogboekLogger) InfoPush(ctx context.Context, group, format string, a ...interface{})
func (*LogboekLogger) Trace ¶
func (l *LogboekLogger) Trace(ctx context.Context, format string, a ...interface{})
func (*LogboekLogger) TracePop ¶
func (l *LogboekLogger) TracePop(ctx context.Context, group string)
func (*LogboekLogger) TracePush ¶
func (l *LogboekLogger) TracePush(ctx context.Context, group, format string, a ...interface{})
func (*LogboekLogger) TraceStruct ¶
func (l *LogboekLogger) TraceStruct(ctx context.Context, obj interface{}, format string, a ...interface{})
type Logger ¶
type Logger interface {
Trace(ctx context.Context, format string, a ...interface{})
TraceStruct(ctx context.Context, obj interface{}, format string, a ...interface{})
TracePush(ctx context.Context, group, format string, a ...interface{})
TracePop(ctx context.Context, group string)
Debug(ctx context.Context, format string, a ...interface{})
DebugPush(ctx context.Context, group, format string, a ...interface{})
DebugPop(ctx context.Context, group string)
Info(ctx context.Context, format string, a ...interface{})
InfoPush(ctx context.Context, group, format string, a ...interface{})
InfoPop(ctx context.Context, group string)
Warn(ctx context.Context, format string, a ...interface{})
WarnPush(ctx context.Context, group, format string, a ...interface{})
WarnPop(ctx context.Context, group string)
Error(ctx context.Context, format string, a ...interface{})
ErrorPush(ctx context.Context, group, format string, a ...interface{})
ErrorPop(ctx context.Context, group string)
InfoBlock(ctx context.Context, opts BlockOptions, fn func())
InfoBlockErr(ctx context.Context, opts BlockOptions, fn func() error) error
BlockContentWidth(ctx context.Context) int
SetLevel(ctx context.Context, lvl Level)
Level(ctx context.Context) Level
AcceptLevel(ctx context.Context, lvl Level) bool
}
type NullLogger ¶
type NullLogger struct{}
func NewNullLogger ¶
func NewNullLogger() *NullLogger
func (*NullLogger) AcceptLevel ¶
func (l *NullLogger) AcceptLevel(ctx context.Context, lvl Level) bool
func (*NullLogger) BlockContentWidth ¶ added in v1.9.0
func (l *NullLogger) BlockContentWidth(ctx context.Context) int
func (*NullLogger) Debug ¶
func (l *NullLogger) Debug(ctx context.Context, format string, a ...interface{})
func (*NullLogger) DebugPush ¶
func (l *NullLogger) DebugPush(ctx context.Context, group, format string, a ...interface{})
func (*NullLogger) Error ¶
func (l *NullLogger) Error(ctx context.Context, format string, a ...interface{})
func (*NullLogger) ErrorPush ¶
func (l *NullLogger) ErrorPush(ctx context.Context, group, format string, a ...interface{})
func (*NullLogger) Info ¶
func (l *NullLogger) Info(ctx context.Context, format string, a ...interface{})
func (*NullLogger) InfoBlock ¶
func (l *NullLogger) InfoBlock(ctx context.Context, opts BlockOptions, fn func())
func (*NullLogger) InfoBlockErr ¶ added in v1.5.0
func (l *NullLogger) InfoBlockErr(ctx context.Context, opts BlockOptions, fn func() error) error
func (*NullLogger) InfoPush ¶
func (l *NullLogger) InfoPush(ctx context.Context, group, format string, a ...interface{})
func (*NullLogger) Trace ¶
func (l *NullLogger) Trace(ctx context.Context, format string, a ...interface{})
func (*NullLogger) TracePush ¶
func (l *NullLogger) TracePush(ctx context.Context, group, format string, a ...interface{})
func (*NullLogger) TraceStruct ¶
func (l *NullLogger) TraceStruct(ctx context.Context, obj interface{}, format string, a ...interface{})
Click to show internal directories.
Click to hide internal directories.