-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move xorm logger bridge from log to models so that log module could be a standalone package #6944
Conversation
…e a standalone package
models/log.go
Outdated
func InitXORMLogger(showSQL bool) { | ||
XORMLogger = &XORMLogBridge{ | ||
// NeXORMLogger inits a log bridge for xorm | ||
func NeXORMLogger(showSQL bool) core.ILogger { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func NeXORMLogger(showSQL bool) core.ILogger { | |
func NewXORMLogger(showSQL bool) core.ILogger { |
models/models.go
Outdated
@@ -261,7 +260,7 @@ func NewTestEngine(x *xorm.Engine) (err error) { | |||
} | |||
|
|||
x.SetMapper(core.GonicMapper{}) | |||
x.SetLogger(log.XORMLogger) | |||
x.SetLogger(NeXORMLogger(!setting.ProdMode)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x.SetLogger(NeXORMLogger(!setting.ProdMode)) | |
x.SetLogger(NewXORMLogger(!setting.ProdMode)) |
models/models.go
Outdated
@@ -276,7 +275,7 @@ func SetEngine() (err error) { | |||
x.SetMapper(core.GonicMapper{}) | |||
// WARNING: for serv command, MUST remove the output to os.stdout, | |||
// so use log file to instead print to stdout. | |||
x.SetLogger(log.XORMLogger) | |||
x.SetLogger(NeXORMLogger(setting.LogSQL)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x.SetLogger(NeXORMLogger(setting.LogSQL)) | |
x.SetLogger(NewXORMLogger(setting.LogSQL)) |
Codecov Report
@@ Coverage Diff @@
## master #6944 +/- ##
=========================================
+ Coverage 41.39% 41.4% +0.01%
=========================================
Files 441 441
Lines 59733 59729 -4
=========================================
+ Hits 24727 24732 +5
+ Misses 31767 31758 -9
Partials 3239 3239
Continue to review full report at Codecov.
|
As title.