feat: add debug log control and optimize error response and cors log
- add DebugLog global variable controlled by BYTEDANCE_TTS_DEBUG env - enable debug logs for cors, tts upstream, response parsing etc when debug mode is on - update tts error response to use standardized json error format - add dashboard and metrics path to cache-control exempt list
This commit is contained in:
+1
-1
@@ -162,7 +162,7 @@ func OpenaiTTSHandler(w http.ResponseWriter, r *http.Request) {
|
||||
metrics.RequestDuration.Observe(duration.Seconds(), telemetry.Labels{"status": finalLabels["status"], "format": clientFormat})
|
||||
log.Printf("警告: TTS 合成失败 - 路径=%s 客户端=%s 文本长度=%d 耗时=%v 错误=%v",
|
||||
r.URL.Path, middleware.GetClientIP(r), len(req.Input), duration, err)
|
||||
http.Error(w, "TTS synthesis failed", http.StatusInternalServerError)
|
||||
middleware.SendJSONError(w, http.StatusInternalServerError, "TTS synthesis failed.", "server_error", "synthesis_failed")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user