perf: avoid eager formatting in debug log calls (#4929)
This commit is contained in:
@@ -102,7 +102,7 @@ func TextHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types
|
||||
}
|
||||
if common.DebugEnabled {
|
||||
if debugBytes, bErr := storage.Bytes(); bErr == nil {
|
||||
println("requestBody: ", string(debugBytes))
|
||||
logger.LogDebug(c, "requestBody: %s", debugBytes)
|
||||
}
|
||||
}
|
||||
requestBody = common.ReaderOnly(storage)
|
||||
@@ -174,7 +174,7 @@ func TextHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types
|
||||
}
|
||||
}
|
||||
|
||||
logger.LogDebug(c, fmt.Sprintf("text request body: %s", string(jsonData)))
|
||||
logger.LogDebug(c, "text request body: %s", jsonData)
|
||||
|
||||
requestBody = bytes.NewBuffer(jsonData)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user