log

package
v0.0.0-...-45466fc Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package log provides utilities for using log/slog with hqtt.

Index

Constants

View Source
const (
	ComponentKey = "component"
	ErrorKey     = "error"
)

Variables

This section is empty.

Functions

func Error

func Error(e error) slog.Attr

Error returns a slog.Attr for the provided error. The key will be ErrorKey.

func ForComponent

func ForComponent(component string) *slog.Logger

ForComponent constructs a slog.Logger for the specified component (which is stored in an attribute with the key ComponentKey).

func To

func To(h slog.Handler)

To updates all slog.Logger objects used internally by hqtt to write logs to the provided slog.Handler. By default, log values will be discarded unless To is called at least once with a non-discarding slog.Handler.

Types

This section is empty.

Jump to

Keyboard shortcuts

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