😄 zapgorm2 is a zap logging driver for gorm v2
If you're using gorm v1, you can use https://github.com/moul/zapgorm instead.
import "moul.io/zapgorm2"
logger := zapgorm2.New(zap.L())
logger.SetAsDefault() // optional: configure gorm to use this zapgorm.Logger for callbacks
db, err = gorm.Open(sqlite.Open("./db.sqlite"), &gorm.Config{Logger: logger})
$ go get -u moul.io/zapgorm2
© 2020-2021 Manfred Touron
Licensed under the Apache License, Version 2.0 (LICENSE-APACHE
) or the MIT license (LICENSE-MIT
), at your option. See the COPYRIGHT
file for more details.
SPDX-License-Identifier: (Apache-2.0 OR MIT)