package
module
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: Oct 20, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
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
¶
New creates a log adapter from sqldblogger.Logger to an slog.Logger one.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.