Documentation
¶
Index ¶
- type ContextFieldExtractor
- type Logger
- func (l *Logger) Debug(ctx context.Context, msg string, attrs ...loggerApi.Attribute)
- func (l *Logger) Debugf(ctx context.Context, msg string, attrs ...map[string]interface{})
- func (l *Logger) DisableDebugMessages()
- func (l *Logger) Error(ctx context.Context, msg string, attrs ...loggerApi.Attribute)
- func (l *Logger) Errorf(ctx context.Context, msg string, attrs ...map[string]interface{})
- func (l *Logger) Fatal(ctx context.Context, msg string, attrs ...loggerApi.Attribute)
- func (l *Logger) Fatalf(ctx context.Context, msg string, attrs ...map[string]interface{})
- func (l *Logger) Info(ctx context.Context, msg string, attrs ...loggerApi.Attribute)
- func (l *Logger) Infof(ctx context.Context, msg string, attrs ...map[string]interface{})
- func (l *Logger) InnerLogger() *slog.Logger
- func (l *Logger) Internal(ctx context.Context, msg string, attrs ...loggerApi.Attribute)
- func (l *Logger) Internalf(ctx context.Context, msg string, attrs ...map[string]interface{})
- func (l *Logger) Level() string
- func (l *Logger) SetContextFieldExtractor(extractor ContextFieldExtractor)
- func (l *Logger) SetErrorStacktrace(enabled bool)
- func (l *Logger) SetLogLevel(level string) (string, error)
- func (l *Logger) Warn(ctx context.Context, msg string, attrs ...loggerApi.Attribute)
- func (l *Logger) Warnf(ctx context.Context, msg string, attrs ...map[string]interface{})
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextFieldExtractor ¶
ContextFieldExtractor is a function that receives a context and should return a slice of loggerApi.Attribute to be added into every log call.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) DisableDebugMessages ¶
func (l *Logger) DisableDebugMessages()
DisableDebugMessages is a helper method to disable Debug level messages.
func (*Logger) InnerLogger ¶
func (*Logger) SetContextFieldExtractor ¶
func (l *Logger) SetContextFieldExtractor(extractor ContextFieldExtractor)
SetContextFieldExtractor adds a custom function to extract values from the context and add them into the log messages.
func (*Logger) SetErrorStacktrace ¶
SetErrorStacktrace lets one enable or disable the runtime stacktrace that error messages can show.
func (*Logger) SetLogLevel ¶
SetLogLevel changes the current messages log level.
Click to show internal directories.
Click to hide internal directories.