logging

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logging owns stderr diagnostics independently of command result streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(logger *slog.Logger, level slog.Level, message string, attrs ...slog.Attr) error

Emit preserves write failures instead of discarding handler errors.

func Failure

func Failure(logger *slog.Logger, err error, contextAttrs ...slog.Attr) error

Failure reports a command failure once, with upstream diagnostics separate from user guidance.

func New

func New(w io.Writer, level, format string) (*slog.Logger, error)

New creates an invocation-local logger. It never changes slog's process default.

func Writer

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

Writer adapts existing stderr notes to the invocation's diagnostic format. Command result writers are never routed through this adapter.

Types

type Reported

type Reported struct {
	Failed, Total int
	Cause         error
}

Reported marks a batch whose individual errors were already emitted.

func (*Reported) Error

func (e *Reported) Error() string

func (*Reported) Unwrap

func (e *Reported) Unwrap() error

Jump to

Keyboard shortcuts

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