slog

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package slog provides the official log/slog integration for postgres-sqlguard validation outcomes.

Logger emits the stable message "sqlguard validation" with only mode, outcome, and rule_id attributes. It invokes the configured handler with a clean background context so SQL data and caller-context values do not cross the integration boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger emits bounded postgres-sqlguard validation records through a configured log/slog handler.

func New

func New(logger *stdslog.Logger) (*Logger, error)

New validates logger and returns a logging implementation backed by its handler.

func (*Logger) LogValidation

func (l *Logger) LogValidation(event sqlguard.ValidationEvent) error

LogValidation logs one bounded validation event.

Jump to

Keyboard shortcuts

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