Browse Source

fix panic when push but the only log mode console is disabled by serv and update commands (#1007)

for-closed-social
Lunny Xiao 7 years ago
committed by GitHub
parent
commit
d6748284bd
2 changed files with 11 additions and 0 deletions
  1. +7
    -0
      modules/log/xorm.go
  2. +4
    -0
      modules/setting/setting.go

+ 7
- 0
modules/log/xorm.go View File

@ -22,6 +22,13 @@ var (
XORMLogger *XORMLogBridge
)
// DiscardXORMLogger inits a blank logger for xorm
func DiscardXORMLogger() {
XORMLogger = &XORMLogBridge{
showSQL: false,
}
}
// NewXORMLogger generate logger for xorm FIXME: configable
func NewXORMLogger(bufferlen int64, mode, config string) {
logger := newLogger(bufferlen)

+ 4
- 0
modules/setting/setting.go View File

@ -1096,6 +1096,10 @@ func NewXORMLogService(disableConsole bool) {
}
log.XORMLogger.SetLevel(lvl)
}
if len(logConfigs) == 0 {
log.DiscardXORMLogger()
}
}
func newCacheService() {

Loading…
Cancel
Save