fix: only setup logx once (#2188)

* fix: only setup logx once

* fix: test failure

* chore: not reset logging level in reset

* chore: refactoring
This commit is contained in:
Kevin Wan
2022-07-28 22:08:48 +08:00
committed by GitHub
parent 3d38d36605
commit 5cd9229986
3 changed files with 21 additions and 29 deletions

View File

@@ -16,7 +16,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/service"
"github.com/zeromicro/go-zero/rest/chain"
"github.com/zeromicro/go-zero/rest/httpx"
"github.com/zeromicro/go-zero/rest/router"
@@ -105,18 +104,6 @@ Port: 54321
}
}
func TestNewServerError(t *testing.T) {
_, err := NewServer(RestConf{
ServiceConf: service.ServiceConf{
Log: logx.LogConf{
// file mode, no path specified
Mode: "file",
},
},
})
assert.NotNil(t, err)
}
func TestWithMaxBytes(t *testing.T) {
const maxBytes = 1000
var fr featuredRoutes