Skip to content

Commit

Permalink
chore: not reset logging level in reset
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan committed Jul 28, 2022
1 parent 1542c1e commit dde578f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
2 changes: 0 additions & 2 deletions core/logx/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ func MustSetup(c LogConf) {

// Reset clears the writer and resets the log level.
func Reset() Writer {
atomic.StoreUint32(&setupOnce, 0)
SetLevel(InfoLevel)
return writer.Swap(nil)
}

Expand Down
14 changes: 0 additions & 14 deletions rest/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -105,19 +104,6 @@ Port: 54321
}
}

func TestNewServerError(t *testing.T) {
logx.Reset()
_, 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
Expand Down

0 comments on commit dde578f

Please sign in to comment.