Documentation
¶
Overview ¶
Package logging provides a configured slog logger for db-catalyst.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string, args ...any)
Info(msg string, args ...any)
Warn(msg string, args ...any)
Error(msg string, args ...any)
With(args ...any) Logger
}
Logger is a generic logging interface that abstracts slog.
type Options ¶
type Options struct {
// Verbose toggles debug level logging when true.
Verbose bool
// Writer directs log output; defaults to os.Stderr when nil.
Writer io.Writer
}
Options configures the default slog logger used by db-catalyst.
type SlogAdapter ¶
type SlogAdapter struct {
// contains filtered or unexported fields
}
SlogAdapter adapts *slog.Logger to the Logger interface.
func NewSlogAdapter ¶
func NewSlogAdapter(logger *slog.Logger) *SlogAdapter
NewSlogAdapter creates a new SlogAdapter.
func (*SlogAdapter) Debug ¶
func (s *SlogAdapter) Debug(msg string, args ...any)
Debug logs a debug message.
func (*SlogAdapter) Error ¶
func (s *SlogAdapter) Error(msg string, args ...any)
Error logs an error message.
func (*SlogAdapter) Info ¶
func (s *SlogAdapter) Info(msg string, args ...any)
Info logs an info message.
func (*SlogAdapter) Warn ¶
func (s *SlogAdapter) Warn(msg string, args ...any)
Warn logs a warning message.
func (*SlogAdapter) With ¶
func (s *SlogAdapter) With(args ...any) Logger
With returns a new Logger with the given attributes.
Click to show internal directories.
Click to hide internal directories.