logger

package
v0.0.0-...-d6efe1e Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithColor

func WithColor() func(*Log)

WithColor provides an optional configuration to colorize the output logs.

Types

type Log

type Log struct {
	Handler slog.Handler
	// contains filtered or unexported fields
}

func New

func New(w io.Writer, serviceName string, opts ...func(*Log)) *Log

func (*Log) Debug

func (log *Log) Debug(ctx context.Context, msg string, args ...any)

func (*Log) Error

func (log *Log) Error(ctx context.Context, msg string, args ...any)

func (*Log) ErrorWithCaller

func (log *Log) ErrorWithCaller(ctx context.Context, caller int, msg string, args ...any)

ErrorWithCaller lets you define your own custom call stack.

func (*Log) Info

func (log *Log) Info(ctx context.Context, msg string, args ...any)

func (*Log) Warn

func (log *Log) Warn(ctx context.Context, msg string, args ...any)

Jump to

Keyboard shortcuts

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