Custom GORM logger implementation enhanced with SugarLogger for improved log level management and standardized log outputs.
- Integrate GORM database logging with the powerful SugarLogger library.
- Easily manage log levels and control verbosity for debugging.
- Standardized and customizable log outputs for better readability and analysis.
Now you can add this package via;
go get -u github.com/erhanakp/sugaredgorm
Install godoc for documentation;
go install golang.org/x/tools/cmd/godoc@latest
zap := zap.NewExample()
gormLoggerValue := sugaredgorm.New(zap.Sugar(), sugaredgorm.Config{
SlowThreshold: 200 * time.Millisecond,
Colorful: true,
IgnoreRecordNotFoundError: true,
ParameterizedQueries: true,
})
_, err := gorm.Open(postgres.New(postgres.Config{
DSN: "host=localhost",
}), &gorm.Config{
Logger: gormLoggerValue,
})
rake -T
rake bump[revision] # bump version, default is: patch
rake doc[port] # run doc server
rake lint # run golangci-lint
rake publish[revision] # publish new version of the library, default is: patch
rake test # run tests
- Erhan Akpınar - Creator, maintainer
- Uğur "vigo" Özyılmazel - Contributor
All PR’s are welcome!
fork
(https://github.com/erhanakp/sugaredgorm/fork)- Create your
branch
(git checkout -b my-feature
) commit
yours (git commit -am 'add some functionality'
)push
yourbranch
(git push origin my-feature
)- Than create a new Pull Request!
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
This project is licensed under MIT