Documentation
¶
Index ¶
- func AddLogEntryHandler(handler LogEntryHandler)
- func Alertf(ctx context.Context, format string, args ...any)
- func Criticalf(ctx context.Context, format string, args ...any)
- func Debugf(ctx context.Context, format string, args ...any)
- func Defaultf(ctx context.Context, format string, args ...any)
- func Errorf(ctx context.Context, format string, args ...any)
- func GetLabels(c context.Context) map[string]string
- func GetSpanID(c context.Context) string
- func GetTraceID(c context.Context) string
- func Infof(ctx context.Context, format string, args ...any)
- func Log(ctx context.Context, entry LogEntry)
- func Logf(ctx context.Context, severity Severity, format string, args ...any)
- func Noticef(ctx context.Context, format string, args ...any)
- func Warningf(ctx context.Context, format string, args ...any)
- func WithLabels(c context.Context, labels map[string]string) context.Context
- func WithSpanID(c context.Context, spanID string) context.Context
- func WithTraceID(c context.Context, traceID string) context.Context
- type LogEntry
- type LogEntryHandler
- type Logger
- type Severity
- type SimpleLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLogEntryHandler ¶
func AddLogEntryHandler(handler LogEntryHandler)
func GetTraceID ¶
GetTraceID returns trace ID from context
func WithLabels ¶
WithLabels adds labels to context
func WithSpanID ¶
WithSpanID adds span ID to context
Types ¶
type LogEntry ¶
type LogEntry struct {
Severity Severity
Component string
MessageFormat string
MessageArgs []any
Payload any
}
LogEntry hold data to be logged
type LogEntryHandler ¶
LogEntryHandler should implement persistence of logs entries
func NewStandardGoLogger ¶
func NewStandardGoLogger() LogEntryHandler
type SimpleLogger ¶
type SimpleLogger interface {
Debugf(ctx context.Context, format string, args ...any)
Infof(ctx context.Context, format string, args ...any)
Errorf(ctx context.Context, format string, args ...any)
Warningf(ctx context.Context, format string, args ...any)
Criticalf(ctx context.Context, format string, args ...any)
}
func GetSimpleLogger ¶ added in v0.1.0
func GetSimpleLogger() SimpleLogger
Click to show internal directories.
Click to hide internal directories.