logger

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(bc *corev1.Bootstrap, opts ...Option) (*slog.Logger, func(context.Context) error)

New assembles a logger from Bootstrap proto config. Returns a stdlib *slog.Logger and a closer (always non-nil; no-op when no OTel backend is active). Callers MUST invoke closer on shutdown.

Types

type LogHandlerFunc

type LogHandlerFunc func(w io.Writer, level slog.Level) slog.Handler

LogHandlerFunc is a factory that produces an slog.Handler writing to w. Servora calls it once per local backend (stdout / file), providing the appropriate io.Writer. OTel backend is independent and unaffected.

type Option

type Option func(*options)

Option configures logger.New.

func WithLogHandlerFunc

func WithLogHandlerFunc(f LogHandlerFunc) Option

WithLogHandlerFunc replaces the default zerolog encoding engine for stdout and file backends. The factory is called with the io.Writer that servora manages (os.Stdout or lumberjack). OTel is unaffected.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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