Documentation ¶
Index ¶
- type BasicLogger
- func (b *BasicLogger) Debug(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) DebugWithTime(logTime time.Time, fields map[string]interface{}, format string, ...)
- func (b *BasicLogger) Error(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) ErrorWithTime(logTime time.Time, fields map[string]interface{}, format string, ...)
- func (b *BasicLogger) Fatal(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) FatalWithTime(logTime time.Time, fields map[string]interface{}, format string, ...)
- func (b *BasicLogger) GetCurrentLevel() string
- func (b *BasicLogger) Info(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) InfoWithTime(logTime time.Time, fields map[string]interface{}, format string, ...)
- func (b *BasicLogger) NewLogger(component string) Logger
- func (b *BasicLogger) SetLogLevel(verbosity string)
- func (b *BasicLogger) Trace(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) TraceWithTime(logTime time.Time, fields map[string]interface{}, format string, ...)
- func (b *BasicLogger) Warn(fields map[string]interface{}, format string, args ...interface{})
- func (b *BasicLogger) WarnWithTime(logTime time.Time, fields map[string]interface{}, format string, ...)
- func (b *BasicLogger) WithContext(ctx context.Context) TraceLogger
- type CallerHook
- type Config
- type Logger
- type Message
- type TraceLogger
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) Debug ¶
func (b *BasicLogger) Debug(fields map[string]interface{}, format string, args ...interface{})
Debug Log print a message with debug level.
func (*BasicLogger) DebugWithTime ¶
func (b *BasicLogger) DebugWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{})
DebugWithTime implements Logger
func (*BasicLogger) Error ¶
func (b *BasicLogger) Error(fields map[string]interface{}, format string, args ...interface{})
Error Log print a message with error level.
func (*BasicLogger) ErrorWithTime ¶
func (b *BasicLogger) ErrorWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{})
ErrorWithTime implements Logger
func (*BasicLogger) Fatal ¶
func (b *BasicLogger) Fatal(fields map[string]interface{}, format string, args ...interface{})
Fatal Log print a message with fatal level.
func (*BasicLogger) FatalWithTime ¶
func (b *BasicLogger) FatalWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{})
FatalWithTime implements Logger
func (*BasicLogger) GetCurrentLevel ¶
func (b *BasicLogger) GetCurrentLevel() string
func (*BasicLogger) Info ¶
func (b *BasicLogger) Info(fields map[string]interface{}, format string, args ...interface{})
Info Log print a message with info level.
func (*BasicLogger) InfoWithTime ¶
func (b *BasicLogger) InfoWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{})
InfoWithTime implements Logger
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
func (*BasicLogger) Trace ¶
func (b *BasicLogger) Trace(fields map[string]interface{}, format string, args ...interface{})
Trace Log print a message with debug level.
func (*BasicLogger) TraceWithTime ¶
func (b *BasicLogger) TraceWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{})
TraceWithTime implements Logger
func (*BasicLogger) Warn ¶
func (b *BasicLogger) Warn(fields map[string]interface{}, format string, args ...interface{})
Warn Log print a message with warn level.
func (*BasicLogger) WarnWithTime ¶
func (b *BasicLogger) WarnWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{})
WarnWithTime implements Logger
func (*BasicLogger) WithContext ¶
func (b *BasicLogger) WithContext(ctx context.Context) TraceLogger
WithContext implements Logger
type Config ¶
Config defines the config structure
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlagsWithPrefix is used to register flags
type Logger ¶
type Logger interface { // Trace print a message with trace level. Trace(fields map[string]interface{}, format string, args ...interface{}) // Debug print a message with debug level. Debug(fields map[string]interface{}, format string, args ...interface{}) // Info print a message with info level. Info(fields map[string]interface{}, format string, args ...interface{}) // Warn print a message with warn level. Warn(fields map[string]interface{}, format string, args ...interface{}) // Error print a message with error level. Error(fields map[string]interface{}, format string, args ...interface{}) // Fatal print a message with fatal level. Fatal(fields map[string]interface{}, format string, args ...interface{}) // Trace print a message with trace level. TraceWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{}) // Debug print a message with debug level. DebugWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{}) // Info print a message with info level. InfoWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{}) // Warn print a message with warn level. WarnWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{}) // Error print a message with error level. ErrorWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{}) // Fatal print a message with fatal level. FatalWithTime(logTime time.Time, fields map[string]interface{}, format string, args ...interface{}) // WithContext trade log. WithContext(ctx context.Context) TraceLogger // NewLogger is used to derive a new child Logger NewLogger(component string) Logger // SetLogLevel is used to set log level SetLogLevel(verbosity string) GetCurrentLevel() string }
Logger defines the basic log library implementation
func NewDefault ¶
NewDefault is used to initialize a simple Logger