logging

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 2 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

Index

Constants

View Source
const (
	// CategoryAccess tags access logs.
	CategoryAccess = "access"
	// CategoryBusiness tags domain logs.
	CategoryBusiness = "business"
	// CategorySystem tags system logs.
	CategorySystem = "system"
)

Variables

This section is empty.

Functions

func AccessLogger added in v0.22.0

func AccessLogger(logger *slog.Logger) *slog.Logger

AccessLogger returns a logger tagged for access logs.

func BusinessLogger added in v0.22.0

func BusinessLogger(logger *slog.Logger) *slog.Logger

BusinessLogger returns a logger tagged for business logs.

func SetupLogger

func SetupLogger(format LogFormat, debug bool, output io.Writer) *slog.Logger

SetupLogger configures a structured logger with the specified format and debug mode.

func SystemLogger added in v0.22.0

func SystemLogger(logger *slog.Logger) *slog.Logger

SystemLogger returns a logger tagged for system logs.

func WithCategory added in v0.22.0

func WithCategory(logger *slog.Logger, category string) *slog.Logger

WithCategory adds a category field to the logger.

Types

type Event added in v0.22.0

type Event int

Event represents a structured log event identifier.

const (
	EventEncodeResponseFailed Event = iota
	EventHeartbeatMailboxFull
	EventHeartbeatMetadataMissing
	EventHeartbeatStarted
	EventHistoryDropped
	EventNotificationDelivered
	EventNotificationDeliveryFailed
	EventNotificationMissing
	EventNotificationTargetDelivered
	EventNotificationTargetDispatch
	EventNotificationTargetFailed
	EventReceiverEmpty
	EventReceiverMissing
	EventRoutesMounted
	EventStageTransition
	EventWebhookResponse
)

func (Event) String added in v0.22.0

func (e Event) String() string

String returns the log event identifier.

type LogFormat

type LogFormat string

LogFormat defines the supported log formats.

const (
	// LogFormatText logs in a human-readable format.
	LogFormatText LogFormat = "text"
	// LogFormatJSON logs in a JSON format.
	LogFormatJSON LogFormat = "json"
)

Jump to

Keyboard shortcuts

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