pgxzero

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelMapper added in v0.0.7

type LevelMapper = func(tracelog.LogLevel, string) zerolog.Level

LevelMapper converts pgx Log levels to zerolog levels. This allows custom overrides for the levels provided by pgx.

type Logger

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

Logger manages mapping pgx error messages to Zerolog.

func New

func New(logger zerolog.Logger) *Logger

New converts pgx logging messages to zerolog.

func (*Logger) Log

func (l *Logger) Log(ctx context.Context, level tracelog.LogLevel, msg string, data map[string]any)

Log is the pgx Logger interface contract.

func (*Logger) WithMapper added in v0.0.7

func (l *Logger) WithMapper(m LevelMapper) *Logger

Jump to

Keyboard shortcuts

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