logging

package
v11.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelTrace = slog.Level(-8)
	LevelFatal = slog.Level(12)
)

Variables

View Source
var DefaultLogFile = filepath.Join(xdg.ConfigHome, "go-hass-anything			.log")
View Source
var LevelNames = map[slog.Leveler]string{
	LevelTrace: "TRACE",
	LevelFatal: "FATAL",
}

Functions

func FromContext

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

func New

func New(level string, noLogFile bool) *slog.Logger

func Reset

func Reset() error

Reset will remove the log file.

func StartProfiling

func StartProfiling(flags ProfileFlags) error

func StopProfiling

func StopProfiling(flags ProfileFlags) error

func ToContext

func ToContext(ctx context.Context, logger *slog.Logger) context.Context

Types

type ProfileFlags

type ProfileFlags map[string]string

Jump to

Keyboard shortcuts

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