logging

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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