stdlog

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package stdlog provides a logger implementation using the standard library's slog package used as adapter for logging interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSlogLogger

func NewSlogLogger(w io.Writer, isText bool) *slog.Logger

NewSlogLogger creates a new slog.Logger instance with the specified writer and format.

Types

type SlogLogger

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

SlogLogger is the implementation of Logger using slog.

func NewLogger

func NewLogger(logger *slog.Logger) *SlogLogger

NewLogger creates a new SlogLogger instance.

func (*SlogLogger) Errorf

func (l *SlogLogger) Errorf(format string, args ...any)

Errorf logs error messages using slog's Error level.

func (*SlogLogger) Logf

func (l *SlogLogger) Logf(format string, args ...any)

Logf logs informational messages using slog's Info level.

Jump to

Keyboard shortcuts

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