1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 02:50:49 +00:00

fix the log carsh before init

This commit is contained in:
astaxie 2016-01-06 11:48:23 +08:00
parent f7ef4aa7e5
commit 8929814126
2 changed files with 8 additions and 10 deletions

View File

@ -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
View File

@ -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)