Documentation ¶
Index ¶
- func AllowLevel(name []string, level Level) bool
- func CallAndLogError(f func() error, task string, log Logger)
- func Configure(verbosity int, path *string)
- func GetWriter() io.Writer
- func SetBackend(backend_ Backend)
- func SetMaxLevel(name []string, level Level)
- type Backend
- type BackendLogger
- func (self BackendLogger) AllowLevel(level Level) bool
- func (self BackendLogger) Critical(message string)
- func (self BackendLogger) Criticalf(format string, values ...any)
- func (self BackendLogger) Debug(message string)
- func (self BackendLogger) Debugf(format string, values ...any)
- func (self BackendLogger) Error(message string)
- func (self BackendLogger) Errorf(format string, values ...any)
- func (self BackendLogger) GetMaxLevel() Level
- func (self BackendLogger) Info(message string)
- func (self BackendLogger) Infof(format string, values ...any)
- func (self BackendLogger) Log(level Level, depth int, message string)
- func (self BackendLogger) Logf(level Level, depth int, format string, values ...any)
- func (self BackendLogger) NewMessage(level Level, depth int) Message
- func (self BackendLogger) Notice(message string)
- func (self BackendLogger) Noticef(format string, values ...any)
- func (self BackendLogger) SetMaxLevel(level Level)
- func (self BackendLogger) Warning(message string)
- func (self BackendLogger) Warningf(format string, values ...any)
- type Hierarchy
- type Level
- type Logger
- type Message
- type MockLogger
- func (self MockLogger) AllowLevel(level Level) bool
- func (self MockLogger) Critical(message string)
- func (self MockLogger) Criticalf(format string, values ...any)
- func (self MockLogger) Debug(message string)
- func (self MockLogger) Debugf(format string, values ...any)
- func (self MockLogger) Error(message string)
- func (self MockLogger) Errorf(format string, values ...any)
- func (self MockLogger) GetMaxLevel() Level
- func (self MockLogger) Info(message string)
- func (self MockLogger) Infof(format string, values ...any)
- func (self MockLogger) Log(level Level, depth int, message string)
- func (self MockLogger) Logf(level Level, depth int, format string, values ...any)
- func (self MockLogger) NewMessage(level Level, depth int) Message
- func (self MockLogger) Notice(message string)
- func (self MockLogger) Noticef(format string, values ...any)
- func (self MockLogger) SetMaxLevel(level Level)
- func (self MockLogger) Warning(message string)
- func (self MockLogger) Warningf(format string, values ...any)
- type Node
- type ScopeLogger
- func (self ScopeLogger) AllowLevel(level Level) bool
- func (self ScopeLogger) Critical(message string)
- func (self ScopeLogger) Criticalf(format string, values ...any)
- func (self ScopeLogger) Debug(message string)
- func (self ScopeLogger) Debugf(format string, values ...any)
- func (self ScopeLogger) Error(message string)
- func (self ScopeLogger) Errorf(format string, values ...any)
- func (self ScopeLogger) GetMaxLevel() Level
- func (self ScopeLogger) Info(message string)
- func (self ScopeLogger) Infof(format string, values ...any)
- func (self ScopeLogger) Log(level Level, depth int, message string)
- func (self ScopeLogger) Logf(level Level, depth int, format string, values ...any)
- func (self ScopeLogger) NewMessage(level Level, depth int) Message
- func (self ScopeLogger) Notice(message string)
- func (self ScopeLogger) Noticef(format string, values ...any)
- func (self ScopeLogger) SetMaxLevel(level Level)
- func (self ScopeLogger) Warning(message string)
- func (self ScopeLogger) Warningf(format string, values ...any)
- type SendUnstructuredMessageFunc
- type UnstructuredMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowLevel ¶ added in v0.1.53
func CallAndLogError ¶ added in v0.1.59
func SetBackend ¶
func SetBackend(backend_ Backend)
func SetMaxLevel ¶
Types ¶
type Backend ¶
type Backend interface { // If "path" is nil will log to stdout, colorized if possible // The default "verbosity" 0 will log criticals, errors, warnings, and notices. // "verbosity" 1 will add infos. "verbosity" 2 will add debugs. // Set "verbostiy" to -1 to disable the log. Configure(verbosity int, path *string) GetWriter() io.Writer NewMessage(name []string, level Level, depth int) Message AllowLevel(name []string, level Level) bool SetMaxLevel(name []string, level Level) GetMaxLevel(name []string) Level }
type BackendLogger ¶ added in v0.1.53
type BackendLogger struct {
// contains filtered or unexported fields
}
func NewBackendLogger ¶ added in v0.1.53
func NewBackendLogger(id []string) BackendLogger
func (BackendLogger) AllowLevel ¶ added in v0.1.53
func (self BackendLogger) AllowLevel(level Level) bool
Logger interface
func (BackendLogger) Critical ¶ added in v0.1.53
func (self BackendLogger) Critical(message string)
Logger interface
func (BackendLogger) Criticalf ¶ added in v0.1.53
func (self BackendLogger) Criticalf(format string, values ...any)
Logger interface
func (BackendLogger) Debug ¶ added in v0.1.53
func (self BackendLogger) Debug(message string)
Logger interface
func (BackendLogger) Debugf ¶ added in v0.1.53
func (self BackendLogger) Debugf(format string, values ...any)
Logger interface
func (BackendLogger) Error ¶ added in v0.1.53
func (self BackendLogger) Error(message string)
Logger interface
func (BackendLogger) Errorf ¶ added in v0.1.53
func (self BackendLogger) Errorf(format string, values ...any)
Logger interface
func (BackendLogger) GetMaxLevel ¶ added in v0.1.64
func (self BackendLogger) GetMaxLevel() Level
Logger interface
func (BackendLogger) Info ¶ added in v0.1.53
func (self BackendLogger) Info(message string)
Logger interface
func (BackendLogger) Infof ¶ added in v0.1.53
func (self BackendLogger) Infof(format string, values ...any)
Logger interface
func (BackendLogger) Log ¶ added in v0.1.53
func (self BackendLogger) Log(level Level, depth int, message string)
Logger interface
func (BackendLogger) Logf ¶ added in v0.1.53
func (self BackendLogger) Logf(level Level, depth int, format string, values ...any)
Logger interface
func (BackendLogger) NewMessage ¶ added in v0.1.53
func (self BackendLogger) NewMessage(level Level, depth int) Message
Logger interface
func (BackendLogger) Notice ¶ added in v0.1.53
func (self BackendLogger) Notice(message string)
Logger interface
func (BackendLogger) Noticef ¶ added in v0.1.53
func (self BackendLogger) Noticef(format string, values ...any)
Logger interface
func (BackendLogger) SetMaxLevel ¶ added in v0.1.53
func (self BackendLogger) SetMaxLevel(level Level)
Logger interface
func (BackendLogger) Warning ¶ added in v0.1.53
func (self BackendLogger) Warning(message string)
Logger interface
func (BackendLogger) Warningf ¶ added in v0.1.53
func (self BackendLogger) Warningf(format string, values ...any)
Logger interface
type Hierarchy ¶ added in v0.1.53
type Hierarchy struct {
// contains filtered or unexported fields
}
func NewMaxLevelHierarchy ¶ added in v0.1.54
func NewMaxLevelHierarchy() *Hierarchy
func (*Hierarchy) AllowLevel ¶ added in v0.1.53
func (*Hierarchy) GetMaxLevel ¶ added in v0.1.54
func (*Hierarchy) SetMaxLevel ¶ added in v0.1.53
type Level ¶
type Level int
func GetMaxLevel ¶ added in v0.1.64
func VerbosityToMaxLevel ¶ added in v0.1.53
type Logger ¶
type Logger interface { NewMessage(level Level, depth int) Message AllowLevel(level Level) bool SetMaxLevel(level Level) GetMaxLevel() Level Log(level Level, depth int, message string) Logf(level Level, depth int, format string, values ...any) Critical(message string) Criticalf(format string, values ...any) Error(message string) Errorf(format string, values ...any) Warning(message string) Warningf(format string, values ...any) Notice(message string) Noticef(format string, values ...any) Info(message string) Infof(format string, values ...any) Debug(message string) Debugf(format string, values ...any) }
func GetLoggerf ¶
type MockLogger ¶ added in v0.1.53
type MockLogger struct{}
var MOCK_LOGGER MockLogger
func (MockLogger) AllowLevel ¶ added in v0.1.53
func (self MockLogger) AllowLevel(level Level) bool
Logger interface
func (MockLogger) Critical ¶ added in v0.1.53
func (self MockLogger) Critical(message string)
Logger interface
func (MockLogger) Criticalf ¶ added in v0.1.53
func (self MockLogger) Criticalf(format string, values ...any)
Logger interface
func (MockLogger) Debug ¶ added in v0.1.53
func (self MockLogger) Debug(message string)
Logger interface
func (MockLogger) Debugf ¶ added in v0.1.53
func (self MockLogger) Debugf(format string, values ...any)
Logger interface
func (MockLogger) Error ¶ added in v0.1.53
func (self MockLogger) Error(message string)
Logger interface
func (MockLogger) Errorf ¶ added in v0.1.53
func (self MockLogger) Errorf(format string, values ...any)
Logger interface
func (MockLogger) GetMaxLevel ¶ added in v0.1.64
func (self MockLogger) GetMaxLevel() Level
Logger interface
func (MockLogger) Info ¶ added in v0.1.53
func (self MockLogger) Info(message string)
Logger interface
func (MockLogger) Infof ¶ added in v0.1.53
func (self MockLogger) Infof(format string, values ...any)
Logger interface
func (MockLogger) Log ¶ added in v0.1.53
func (self MockLogger) Log(level Level, depth int, message string)
Logger interface
func (MockLogger) Logf ¶ added in v0.1.53
func (self MockLogger) Logf(level Level, depth int, format string, values ...any)
Logger interface
func (MockLogger) NewMessage ¶ added in v0.1.53
func (self MockLogger) NewMessage(level Level, depth int) Message
Logger interface
func (MockLogger) Notice ¶ added in v0.1.53
func (self MockLogger) Notice(message string)
Logger interface
func (MockLogger) Noticef ¶ added in v0.1.53
func (self MockLogger) Noticef(format string, values ...any)
Logger interface
func (MockLogger) SetMaxLevel ¶ added in v0.1.53
func (self MockLogger) SetMaxLevel(level Level)
Logger interface
func (MockLogger) Warning ¶ added in v0.1.53
func (self MockLogger) Warning(message string)
Logger interface
func (MockLogger) Warningf ¶ added in v0.1.53
func (self MockLogger) Warningf(format string, values ...any)
Logger interface
type ScopeLogger ¶ added in v0.1.54
type ScopeLogger struct {
// contains filtered or unexported fields
}
func NewScopeLogger ¶ added in v0.1.54
func NewScopeLogger(logger Logger, scope string) ScopeLogger
func (ScopeLogger) AllowLevel ¶ added in v0.1.54
func (self ScopeLogger) AllowLevel(level Level) bool
Logger interface
func (ScopeLogger) Critical ¶ added in v0.1.54
func (self ScopeLogger) Critical(message string)
Logger interface
func (ScopeLogger) Criticalf ¶ added in v0.1.54
func (self ScopeLogger) Criticalf(format string, values ...any)
Logger interface
func (ScopeLogger) Debug ¶ added in v0.1.54
func (self ScopeLogger) Debug(message string)
Logger interface
func (ScopeLogger) Debugf ¶ added in v0.1.54
func (self ScopeLogger) Debugf(format string, values ...any)
Logger interface
func (ScopeLogger) Error ¶ added in v0.1.54
func (self ScopeLogger) Error(message string)
Logger interface
func (ScopeLogger) Errorf ¶ added in v0.1.54
func (self ScopeLogger) Errorf(format string, values ...any)
Logger interface
func (ScopeLogger) GetMaxLevel ¶ added in v0.1.64
func (self ScopeLogger) GetMaxLevel() Level
Logger interface
func (ScopeLogger) Info ¶ added in v0.1.54
func (self ScopeLogger) Info(message string)
Logger interface
func (ScopeLogger) Infof ¶ added in v0.1.54
func (self ScopeLogger) Infof(format string, values ...any)
Logger interface
func (ScopeLogger) Log ¶ added in v0.1.54
func (self ScopeLogger) Log(level Level, depth int, message string)
Logger interface
func (ScopeLogger) Logf ¶ added in v0.1.54
func (self ScopeLogger) Logf(level Level, depth int, format string, values ...any)
Logger interface
func (ScopeLogger) NewMessage ¶ added in v0.1.54
func (self ScopeLogger) NewMessage(level Level, depth int) Message
Logger interface
func (ScopeLogger) Notice ¶ added in v0.1.54
func (self ScopeLogger) Notice(message string)
Logger interface
func (ScopeLogger) Noticef ¶ added in v0.1.54
func (self ScopeLogger) Noticef(format string, values ...any)
Logger interface
func (ScopeLogger) SetMaxLevel ¶ added in v0.1.54
func (self ScopeLogger) SetMaxLevel(level Level)
Logger interface
func (ScopeLogger) Warning ¶ added in v0.1.54
func (self ScopeLogger) Warning(message string)
Logger interface
func (ScopeLogger) Warningf ¶ added in v0.1.54
func (self ScopeLogger) Warningf(format string, values ...any)
Logger interface
type SendUnstructuredMessageFunc ¶ added in v0.1.53
type SendUnstructuredMessageFunc func(message string)
type UnstructuredMessage ¶ added in v0.1.53
type UnstructuredMessage struct {
// contains filtered or unexported fields
}
func NewUnstructuredMessage ¶ added in v0.1.53
func NewUnstructuredMessage(send SendUnstructuredMessageFunc) *UnstructuredMessage
func (*UnstructuredMessage) Send ¶ added in v0.1.53
func (self *UnstructuredMessage) Send()