logger

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package logger adapts go-partial diagnostic events to log/slog.

Index

Constants

View Source
const (
	// EventTemplateLog identifies diagnostic events emitted from templates.
	EventTemplateLog = "ext.logger.template"
)

Variables

This section is empty.

Functions

func FuncMap

func FuncMap() template.FuncMap

FuncMap returns the optional logger template helper for static parsing and docs.

func Logger

func Logger(ctx *partial.RenderContext, message string, pairs ...any) string

Logger emits an info-level diagnostic event from template code.

go-doc:sig func(message string, pairs ...any) string

func Sink

func Sink(log *slog.Logger, options ...Option) partial.EventSink

Sink returns an event sink that writes diagnostic events to slog.

func Stage

func Stage() partial.RenderStage

Stage installs the request-scoped logger template helper.

Types

type Option

type Option func(*config)

Option configures a logger sink.

func WithMinLevel

func WithMinLevel(level partial.EventLevel) Option

WithMinLevel ignores events below level.

Jump to

Keyboard shortcuts

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