Add the ability to set the default Logger
Sometimes you want to have a default logger that is used for all of your database connections; you can now set the default logger using `gorm.SetDefaultLogger`.
This commit is contained in:
parent
b1885a643b
commit
32118f0c44
@ -18,6 +18,11 @@ var (
|
|||||||
numericPlaceHolderRegexp = regexp.MustCompile(`\$\d+`)
|
numericPlaceHolderRegexp = regexp.MustCompile(`\$\d+`)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// SetDefaultLogger replaces the default Logger instance.
|
||||||
|
func SetDefaultLogger(l Logger) {
|
||||||
|
defaultLogger = l
|
||||||
|
}
|
||||||
|
|
||||||
func isPrintable(s string) bool {
|
func isPrintable(s string) bool {
|
||||||
for _, r := range s {
|
for _, r := range s {
|
||||||
if !unicode.IsPrint(r) {
|
if !unicode.IsPrint(r) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user