logger

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logger provides structured logging helpers for pgxcli.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*slog.Logger
	// contains filtered or unexported fields
}

Logger wraps slog.Logger and the underlying file for proper cleanup.

func InitLogger

func InitLogger(debug bool, filename string) (*Logger, error)

InitLogger creates a new structured logger with the specified debug level. It writes to a file (creating parent directories if needed) and returns a Logger wrapper for proper resource management.

func NopLogger

func NopLogger() *Logger

NopLogger returns a logger that discards all output. Useful for testing or when logging is disabled.

func (*Logger) Close

func (l *Logger) Close() error

Close closes the underlying log file if one exists.

Jump to

Keyboard shortcuts

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