loggingsugar

package
v0.0.0-...-68fadb2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type L

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

func (L) A

func (l L) A(name string, value any) L

Add attribute

func (L) Attr

func (l L) Attr(attr slog.Attr) L

Addes attribute

func (L) Context

func (l L) Context(ctx context.Context) context.Context

Gives a new ctx that has a handler with these attributes

func (L) Debug

func (l L) Debug(ctx context.Context, msg string)

handles a new Debug log record

func (L) Err

func (l L) Err(err error) L

Adds an error attribute to be deeply described

func (L) Error

func (l L) Error(ctx context.Context, msg string)

handles a new Error log record

func (L) Handler

func (l L) Handler(ctx context.Context) slog.Handler

Gives new handler with given attributes

func (L) Info

func (l L) Info(ctx context.Context, msg string)

handles a new Info log record

func (L) Log

func (l L) Log(ctx context.Context, level slog.Level, msg string)

handles a new log record

func (L) LogFromWrapper

func (l L) LogFromWrapper(ctx context.Context, additionalWrapDepth int, level slog.Level, msg string)

handles a new log record

func (L) NoSource

func (l L) NoSource() L

Disables source code location resolution (only works when directly logging)

func (L) Warn

func (l L) Warn(ctx context.Context, msg string)

handles a new Warn log record

func (L) Wrap

func (l L) Wrap() L

Increments the wrap depth, which causes more frames to be skipped when resolving the source lines (only works when directly logging)

Jump to

Keyboard shortcuts

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