Documentation
¶
Index ¶
- func FromContext(ctx context.Context) slog.Handler
- func NewHandler(cfg *config.Config) slog.Handler
- func NullHandlerContext(ctx context.Context) context.Context
- func SetDefault(h slog.Handler)
- func WithContext(ctx context.Context, l slog.Handler) context.Context
- type Entry
- func (entry *Entry) Accept(lvl slog.Level) bool
- func (entry *Entry) Caller(caller caller.Caller) *Entry
- func (entry *Entry) Debug(message string, fields ...any)
- func (entry *Entry) Debugf(format string, args ...any)
- func (entry *Entry) Err(err error) *Entry
- func (entry *Entry) Error(message string, fields ...any)
- func (entry *Entry) Errorf(format string, args ...any)
- func (entry *Entry) Info(message string, fields ...any)
- func (entry *Entry) Infof(format string, args ...any)
- func (entry *Entry) Level(lvl slog.Level) *Entry
- func (entry *Entry) Log(message string, fields ...any)
- func (entry *Entry) Warn(message string, fields ...any)
- func (entry *Entry) Warnf(format string, args ...any)
- func (entry *Entry) With(fields ...any) *Entry
- type HTTPClient
- type NullHandler
- type OpenObserveHandler
- func (sl *OpenObserveHandler) Enabled(ctx context.Context, lvl slog.Level) bool
- func (sl *OpenObserveHandler) Handle(ctx context.Context, record slog.Record) error
- func (sl *OpenObserveHandler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (sl *OpenObserveHandler) WithGroup(name string) slog.Handler
- type OpenObserveHandlerOptions
- type PrettyHandler
- type WatermillLogger
- func (wa *WatermillLogger) Debug(msg string, fields watermill.LogFields)
- func (wa *WatermillLogger) Error(msg string, err error, fields watermill.LogFields)
- func (wa *WatermillLogger) Info(msg string, fields watermill.LogFields)
- func (wa *WatermillLogger) Trace(msg string, fields watermill.LogFields)
- func (wa *WatermillLogger) With(fields watermill.LogFields) watermill.LoggerAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶
Types ¶
type NullHandler ¶
type NullHandler struct{}
type OpenObserveHandler ¶
type OpenObserveHandler struct {
// contains filtered or unexported fields
}
func NewOpenObserveHandler ¶
func NewOpenObserveHandler(opts OpenObserveHandlerOptions) *OpenObserveHandler
type OpenObserveHandlerOptions ¶
type OpenObserveHandlerOptions struct {
HandlerOptions *slog.HandlerOptions
// Maximum size for the buffer to store log messages before flushing.
BufferSize int
// Maximum time to wait before flushing the buffer.
BufferTimeout time.Duration
// Maximum number of concurrent requests to send logs.
Concurrency int
// Endpoint to send logs to.
Endpoint string
// HTTPClient to use for sending logs.
HTTPClient HTTPClient
// Attributes to include in every log message.
WithAttrs []slog.Attr
Username string
Password string
}
type PrettyHandler ¶
type PrettyHandler struct {
// contains filtered or unexported fields
}
func NewPrettyHandler ¶
func NewPrettyHandler(writer io.Writer, opts *slog.HandlerOptions) *PrettyHandler
NewPrettyHandler creates a human friendly readable logs.
type WatermillLogger ¶
type WatermillLogger struct {
// contains filtered or unexported fields
}
func (*WatermillLogger) Debug ¶
func (wa *WatermillLogger) Debug(msg string, fields watermill.LogFields)
func (*WatermillLogger) Error ¶
func (wa *WatermillLogger) Error(msg string, err error, fields watermill.LogFields)
func (*WatermillLogger) Info ¶
func (wa *WatermillLogger) Info(msg string, fields watermill.LogFields)
func (*WatermillLogger) Trace ¶
func (wa *WatermillLogger) Trace(msg string, fields watermill.LogFields)
func (*WatermillLogger) With ¶
func (wa *WatermillLogger) With(fields watermill.LogFields) watermill.LoggerAdapter
Click to show internal directories.
Click to hide internal directories.