log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 2 Imported by: ? 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 log provides a minimal logger interface used by the framework.

Consumers wire in their own logger (e.g. a structured logger with secret redaction). The default is a no-op so the module is silent when no logger is supplied, which is the common case in libraries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(l Logger)

Set installs the logger used by all framework packages. Safe to call from init() in the consumer.

Types

type Logger

type Logger interface {
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
}

Logger is the minimal logging surface the framework needs. All methods accept printf-style format strings.

func L

func L() Logger

L returns the currently-installed logger.

type NoopLogger

type NoopLogger struct{}

NoopLogger discards all log output.

func (NoopLogger) Debugf

func (NoopLogger) Debugf(string, ...any)

func (NoopLogger) Errorf

func (NoopLogger) Errorf(string, ...any)

func (NoopLogger) Infof

func (NoopLogger) Infof(string, ...any)

func (NoopLogger) Warnf

func (NoopLogger) Warnf(string, ...any)

type StderrLogger

type StderrLogger struct{}

StderrLogger writes log lines to stderr via fmt.Fprintf. Useful for development; consumers in production should plug in their own logger.

func (StderrLogger) Debugf

func (StderrLogger) Debugf(format string, args ...any)

func (StderrLogger) Errorf

func (StderrLogger) Errorf(format string, args ...any)

func (StderrLogger) Infof

func (StderrLogger) Infof(format string, args ...any)

func (StderrLogger) Warnf

func (StderrLogger) Warnf(format string, args ...any)

Jump to

Keyboard shortcuts

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