Replaced Beego logging

This commit is contained in:
Deluan
2020-01-08 20:45:07 -05:00
committed by Deluan Quintão
parent 6eda38a951
commit 84d69a4f41
28 changed files with 559 additions and 282 deletions
+3 -9
View File
@@ -4,15 +4,12 @@ import (
"os"
"path/filepath"
"runtime"
"sync"
"testing"
"github.com/astaxie/beego"
"github.com/cloudsonic/sonic-server/conf"
"github.com/cloudsonic/sonic-server/log"
)
var initSync sync.Once
func Init(t *testing.T, skipOnShort bool) {
if skipOnShort && testing.Short() {
t.Skip("skipping test in short mode.")
@@ -21,14 +18,11 @@ func Init(t *testing.T, skipOnShort bool) {
appPath, _ := filepath.Abs(filepath.Join(filepath.Dir(file), ".."))
confPath, _ := filepath.Abs(filepath.Join(appPath, "tests", "sonic-test.toml"))
os.Chdir(appPath)
conf.LoadFromFile(confPath)
initSync.Do(func() {
beego.TestBeegoInit(appPath)
})
noLog := os.Getenv("NOLOG")
if noLog != "" {
beego.SetLevel(beego.LevelError)
log.SetLevel(log.LevelError)
}
}