logger

package
v1.5.66-0...-1e0c951 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, v ...any)

func Debugf

func Debugf(format string, v ...any)

func Error

func Error(values ...any) error

you can return this log as well to get log.Fatal effects

func Errorf

func Errorf(format string, v ...any) error

func GetLogFilepath

func GetLogFilepath() string

func Info

func Info(msg string, v ...any)

func Infof

func Infof(format string, v ...any)

func SetCliLogLevel

func SetCliLogLevel(l slog.Level)

func Warn

func Warn(msg string, v ...any)

func Warnf

func Warnf(format string, v ...any)

Types

type CliHandler

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

Log handler specifically for CLI usage.

func NewCliHandler

func NewCliHandler(h slog.Handler) *CliHandler

func (*CliHandler) Enabled

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

func (*CliHandler) Handle

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

func (*CliHandler) Handler

func (h *CliHandler) Handler() slog.Handler

func (*CliHandler) WithAttrs

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

func (*CliHandler) WithGroup

func (h *CliHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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