Documentation ¶
Index ¶
- type Formatter
- type Level
- type Logger
- func (l Logger) Critical(ctx context.Context, err error, args ...any)
- func (l Logger) Debug(ctx context.Context, msg string, args ...any)
- func (l Logger) Error(ctx context.Context, err error, args ...any)
- func (l Logger) Fatal(ctx context.Context, err error, args ...any)
- func (l Logger) Info(ctx context.Context, msg string, args ...any)
- func (l Logger) Warning(ctx context.Context, msg string, args ...any)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter interface { // Format formats the log payload that will be rendered. Format(context.Context, *format.LogInput) any }
Formatter defines how structures that formats logs should behavior.
type Level ¶
type Level int
Level indicates the severity of the data being logged.
const ( // LevelCritical alerts about severe problems. Most of the time, needs some human intervention ASAP. LevelCritical Level = iota + 1 // LevelError alerts about events that are likely to cause problems. LevelError // LevelWarning warns about events the might cause problems to the system. LevelWarning // LevelInfo are routine information. LevelInfo // LevelDebug are debug or trace information. LevelDebug )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the structure responsible for log data.
type Option ¶ added in v1.1.0
type Option func(*Logger)
Option is a type to set Logger options.
func WithContextKeySet ¶ added in v1.1.0
func WithContextKeySet(keys propagation.ContextKeySet) Option
WithContextKeySet instructs the Logger to include the given context keys in logs.
func WithFormatter ¶ added in v1.1.0
WithFormatter instructs the Logger to use the given formatter for logging.
func WithTimmer ¶ added in v1.1.0
WithTimmer instructs the Logger to use the given timmer to get current Time for logging. It must be used just for testing.
Click to show internal directories.
Click to hide internal directories.