chore: let logx.SetWriter can be called anytime (#2186)

This commit is contained in:
Kevin Wan
2022-07-24 14:15:57 +08:00
committed by GitHub
parent 685d14e662
commit 9b334b5428
3 changed files with 5 additions and 8 deletions

View File

@@ -69,8 +69,7 @@ func logDuration(ctx context.Context, method string, req interface{}, duration t
if err != nil {
logx.WithContext(ctx).Errorf("%s - %s", addr, err.Error())
} else if duration > slowThreshold.Load() {
logger.Slowf("[RPC] slowcall - %s - %s - %s",
addr, method, string(content))
logger.Slowf("[RPC] slowcall - %s - %s - %s", addr, method, string(content))
} else {
logger.Infof("%s - %s - %s", addr, method, string(content))
}