cmd

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger() *slog.Logger

func ReadConfig

func ReadConfig(l *slog.Logger, cmd *cobra.Command) (*config.Config, error)

func Tag

func Tag(name string, tags []string) bool

Types

type SlogHandler added in v0.20.0

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

func NewSlogHandler added in v0.20.0

func NewSlogHandler() *SlogHandler

NewSlogHandler returns a new logging handler that can be intrgrated with log/slog.

func (*SlogHandler) Enabled added in v0.20.0

func (s *SlogHandler) Enabled(ctx context.Context, level slog.Level) bool

Enabled returns true if the given level is enabled.

func (*SlogHandler) Handle added in v0.20.0

func (s *SlogHandler) Handle(ctx context.Context, record slog.Record) error

Handle handles the given record.

func (*SlogHandler) WithAttrs added in v0.20.0

func (s *SlogHandler) WithAttrs(attrs []slog.Attr) slog.Handler

WithAttrs returns a new handler with the given attributes.

func (*SlogHandler) WithGroup added in v0.20.0

func (s *SlogHandler) WithGroup(name string) slog.Handler

WithGroup is not yet supported.

Jump to

Keyboard shortcuts

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