logger

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package logger provides a minimal structured-logger interface and a default stdlib-based implementation for the poya SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debug(msg string, keysAndValues ...any)
	Info(msg string, keysAndValues ...any)
	Warn(msg string, keysAndValues ...any)
	Error(msg string, keysAndValues ...any)
}

Logger is the interface used by the poya SDK for all log output. It follows the idiomatic Go pattern (like zap's sugared logger or klog).

func New

func New() Logger

New returns a default Logger that writes to stderr using log/slog.

func NewNoop added in v0.1.14

func NewNoop() Logger

NewNoop returns a Logger that discards every message. Use it to silence SDK logging entirely, the same way github.com/PapaDanielVi/poya/metrics.NoopMetrics disables metrics.

func NewWithHandler

func NewWithHandler(h slog.Handler) Logger

NewWithHandler returns a Logger backed by the given slog.Handler. Useful for tests or custom formatting.

Directories

Path Synopsis
Package logrus implements the poya logger.Logger interface on top of github.com/sirupsen/logrus.
Package logrus implements the poya logger.Logger interface on top of github.com/sirupsen/logrus.
Package zap implements the poya logger.Logger interface on top of go.uber.org/zap.
Package zap implements the poya logger.Logger interface on top of go.uber.org/zap.
Package zerolog implements the poya logger.Logger interface on top of github.com/rs/zerolog.
Package zerolog implements the poya logger.Logger interface on top of github.com/rs/zerolog.

Jump to

Keyboard shortcuts

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