fix: fix switch doesn't work bug (#2183)

This commit is contained in:
benqi
2022-07-23 12:15:37 +08:00
committed by GitHub
parent 92145b56dc
commit edbf1a3b63

View File

@@ -64,8 +64,7 @@ func logDuration(ctx context.Context, method string, req interface{}, duration t
} else {
logger.Infof("%s - %s - %s", addr, method)
}
}
} else {
content, err := json.Marshal(req)
if err != nil {
logx.WithContext(ctx).Errorf("%s - %s", addr, err.Error())
@@ -75,4 +74,5 @@ func logDuration(ctx context.Context, method string, req interface{}, duration t
} else {
logger.Infof("%s - %s - %s", addr, method, string(content))
}
}
}