wdlog

package
v0.0.0-...-b197db6 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package wdlog manages logging in the distillery

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(out io.Writer, level slog.Level) *slog.Logger

New creates a new logger logging into the given output

func Of

func Of(ctx context.Context) *slog.Logger

Of returns the logger stored in context. If no logger is contained in the context, a no-op handler is returned

func Set

func Set(parent context.Context, logger *slog.Logger) context.Context

Set creates a new context that stores the given logger

Types

type Flag

type Flag string

Flag is used to represents a level command line flag.

func (Flag) Level

func (ls Flag) Level() (level slog.Level)

Level parses the string into a log level. If it cannot be parsed, uses the default info level.

Jump to

Keyboard shortcuts

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