Documentation ¶
Index ¶
- type BasicLogger
- func (b *BasicLogger) LogDebug(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) LogError(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) LogFatal(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) LogInfo(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) LogWarn(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) NewLogger(component string) Logger
- func (b *BasicLogger) SetLogLevel(verbosity string)
- type CallerHook
- type Config
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicLogger ¶
type BasicLogger struct {
// contains filtered or unexported fields
}
BasicLogger simply implements Logger
func (*BasicLogger) LogDebug ¶
func (b *BasicLogger) LogDebug(fields map[string]interface{}, format string, args ...interface{})
LogDebug print a message with debug level.
func (*BasicLogger) LogError ¶
func (b *BasicLogger) LogError(fields map[string]interface{}, format string, args ...interface{})
LogError print a message with error level.
func (*BasicLogger) LogFatal ¶
func (b *BasicLogger) LogFatal(fields map[string]interface{}, format string, args ...interface{})
LogFatal print a message with fatal level.
func (*BasicLogger) LogInfo ¶
func (b *BasicLogger) LogInfo(fields map[string]interface{}, format string, args ...interface{})
LogInfo print a message with info level.
func (*BasicLogger) LogWarn ¶
func (b *BasicLogger) LogWarn(fields map[string]interface{}, format string, args ...interface{})
LogWarn print a message with warn level.
func (*BasicLogger) NewLogger ¶
func (b *BasicLogger) NewLogger(component string) Logger
NewLogger is used to derive a new child Logger
func (*BasicLogger) SetLogLevel ¶
func (b *BasicLogger) SetLogLevel(verbosity string)
SetLogLevel is used to set log level
type Logger ¶
type Logger interface { // LogDebug print a message with debug level. LogDebug(fields map[string]interface{}, format string, args ...interface{}) // LogInfo print a message with info level. LogInfo(fields map[string]interface{}, format string, args ...interface{}) // LogWarn print a message with warn level. LogWarn(fields map[string]interface{}, format string, args ...interface{}) // LogError print a message with error level. LogError(fields map[string]interface{}, format string, args ...interface{}) // LogFatal print a message with fatal level. LogFatal(fields map[string]interface{}, format string, args ...interface{}) // NewLogger is used to derive a new child Logger NewLogger(component string) Logger // SetLogLevel is used to set log level SetLogLevel(verbosity string) }
Logger defines the basic log library implementation
func New ¶
func New(cfg *Config, component string, registerer prometheus.Registerer) (Logger, error)
New is used to init service
func NewDefault ¶
NewDefault is used to initialize a simple Logger
Click to show internal directories.
Click to hide internal directories.