fix show SQL when set logger (#1315)

This commit is contained in:
Lunny Xiao 2019-06-06 14:26:23 +08:00 committed by GitHub
parent 8a61b3a8a9
commit 7c4e044547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -125,6 +125,7 @@ func (engine *Engine) Logger() core.ILogger {
// SetLogger set the new logger
func (engine *Engine) SetLogger(logger core.ILogger) {
engine.logger = logger
engine.showSQL = logger.IsShowSQL()
engine.dialect.SetLogger(logger)
}