sqldbloggerslog

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 3 Imported by: 0

README

sqldb-logger-slog

About

This is a log/slog adapter for github.com/simukti/sqldb-logger .

Install

go get github.com/akm/sqldb-logger-slog

Usage

   dsn := "./sqlite3_test.db"
   origDB, err := sql.Open("sqlite3", dsn)
   if err != nil {
   	log.Fatal(err)
   }
   adapter := sqldbloggerslog.New(slog.New(slog.NewJSONHandler(os.Stdout, nil)))
   db := sqldblogger.OpenDriver(dsn, origDB.Driver(), adapter)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger *slog.Logger) sqldblogger.Logger

New creates a log adapter from sqldblogger.Logger to an slog.Logger one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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