dedup

package
v0.0.0-...-4e1e071 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogLevel

func GetLogLevel(logLevel string) slog.Level

GetLogLevel returns the slog.Level for the given logLevel string. It defaults to slog.LevelInfo.

func InitDedupJSONLogger

func InitDedupJSONLogger(logLevel string) *slog.Logger

InitDedupJSONLogger initializes a default slog.Logger with the given logLevel string.

Types

type DedupJSONHandler

type DedupJSONHandler struct {
	// contains filtered or unexported fields
}

func (DedupJSONHandler) Enabled

func (h DedupJSONHandler) Enabled(ctx context.Context, level slog.Level) bool

func (DedupJSONHandler) Handle

func (h DedupJSONHandler) Handle(ctx context.Context, r slog.Record) error

Handle replaces the slog.JSONHandler.Handle method to deduplicate log messages.

func (DedupJSONHandler) WithAttrs

func (h DedupJSONHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (DedupJSONHandler) WithGroup

func (h DedupJSONHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL