mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 09:50:55 +00:00
fix the log carsh before init
This commit is contained in:
parent
f7ef4aa7e5
commit
8929814126
12
beego.go
12
beego.go
@ -20,16 +20,15 @@ import (
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/astaxie/beego/logs"
|
||||
)
|
||||
|
||||
const (
|
||||
// beego web framework version.
|
||||
VERSION = "1.5.0"
|
||||
// VERSION represent beego web framework version.
|
||||
VERSION = "1.6.0"
|
||||
|
||||
// beego run modes
|
||||
DEV = "dev"
|
||||
// DEV is for develop
|
||||
DEV = "dev"
|
||||
// PROD is for production
|
||||
PROD = "prod"
|
||||
)
|
||||
|
||||
@ -75,7 +74,6 @@ func initBeforeHTTPRun() {
|
||||
panic(err)
|
||||
}
|
||||
//init log
|
||||
BeeLogger = logs.NewLogger(10000)
|
||||
for adaptor, config := range BConfig.Log.Output {
|
||||
err = BeeLogger.SetLogger(adaptor, config)
|
||||
if err != nil {
|
||||
|
6
log.go
6
log.go
@ -32,6 +32,9 @@ const (
|
||||
LevelDebug
|
||||
)
|
||||
|
||||
// BeeLogger references the used application logger.
|
||||
var BeeLogger = logs.NewLogger(100)
|
||||
|
||||
// SetLevel sets the global log level used by the simple logger.
|
||||
func SetLevel(l int) {
|
||||
BeeLogger.SetLevel(l)
|
||||
@ -43,9 +46,6 @@ func SetLogFuncCall(b bool) {
|
||||
BeeLogger.SetLogFuncCallDepth(3)
|
||||
}
|
||||
|
||||
// BeeLogger references the used application logger.
|
||||
var BeeLogger *logs.BeeLogger
|
||||
|
||||
// SetLogger sets a new logger.
|
||||
func SetLogger(adaptername string, config string) error {
|
||||
err := BeeLogger.SetLogger(adaptername, config)
|
||||
|
Loading…
Reference in New Issue
Block a user