Documentation ¶
Index ¶
- func ParseDateTimeFormat(str string) (string, error)
- func SetDefault(logger Logger)
- func WithContext(ctx context.Context, logger Logger) context.Context
- type DefaultLogger
- func (l *DefaultLogger) Debug() LoggerEvent
- func (l *DefaultLogger) Emit(ctx context.Context, eventName string, object any)
- func (l *DefaultLogger) EmitWithSource(ctx context.Context, eventName, source string, object any)
- func (l *DefaultLogger) Error() LoggerEvent
- func (l *DefaultLogger) Fatal() LoggerEvent
- func (l *DefaultLogger) Info() LoggerEvent
- func (l *DefaultLogger) Level() Level
- func (l *DefaultLogger) Panic() LoggerEvent
- func (l *DefaultLogger) Printf(format string, args ...any)
- func (l *DefaultLogger) Trace() LoggerEvent
- func (l *DefaultLogger) Warn() LoggerEvent
- func (l *DefaultLogger) With() LoggerContext
- func (l *DefaultLogger) WithContext(ctx context.Context) context.Context
- type Level
- type Logger
- type LoggerContext
- type LoggerEvent
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDateTimeFormat ¶
func SetDefault ¶
func SetDefault(logger Logger)
SetDefault - WARNING: use only when starting the main process
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
func New ¶
func New(level Level) *DefaultLogger
func (*DefaultLogger) Debug ¶
func (l *DefaultLogger) Debug() LoggerEvent
func (*DefaultLogger) Emit ¶
func (l *DefaultLogger) Emit(ctx context.Context, eventName string, object any)
func (*DefaultLogger) EmitWithSource ¶
func (l *DefaultLogger) EmitWithSource(ctx context.Context, eventName, source string, object any)
func (*DefaultLogger) Error ¶
func (l *DefaultLogger) Error() LoggerEvent
func (*DefaultLogger) Fatal ¶
func (l *DefaultLogger) Fatal() LoggerEvent
func (*DefaultLogger) Info ¶
func (l *DefaultLogger) Info() LoggerEvent
func (*DefaultLogger) Level ¶
func (l *DefaultLogger) Level() Level
func (*DefaultLogger) Panic ¶
func (l *DefaultLogger) Panic() LoggerEvent
func (*DefaultLogger) Printf ¶
func (l *DefaultLogger) Printf(format string, args ...any)
func (*DefaultLogger) Trace ¶
func (l *DefaultLogger) Trace() LoggerEvent
func (*DefaultLogger) Warn ¶
func (l *DefaultLogger) Warn() LoggerEvent
func (*DefaultLogger) With ¶
func (l *DefaultLogger) With() LoggerContext
func (*DefaultLogger) WithContext ¶
func (l *DefaultLogger) WithContext(ctx context.Context) context.Context
type Logger ¶
type Logger interface { Level() Level WithContext(ctx context.Context) context.Context With() LoggerContext Debug() LoggerEvent Info() LoggerEvent Warn() LoggerEvent Error() LoggerEvent Fatal() LoggerEvent Panic() LoggerEvent Trace() LoggerEvent Printf(format string, args ...any) }
type LoggerContext ¶
type LoggerContext interface { Logger() Logger CallerWithSkipFrame(count int) LoggerContext Str(key, value string) LoggerContext Bytes(key string, value []byte) LoggerContext Int(key string, value int) LoggerContext Any(key string, value any) LoggerContext }
type LoggerEvent ¶
type LoggerEvent interface { Caller(skip ...int) LoggerEvent CallerSkipFrame(skip int) LoggerEvent Err(err error) LoggerEvent Str(key, value string) LoggerEvent Bytes(key string, value []byte) LoggerEvent Int(key string, value int) LoggerEvent Any(key string, value any) LoggerEvent Msg(message string) Msgf(format string, args ...any) MsgFunc(createMsg func() string) Send() }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.