Skip to content

Commit 8e8c325

Browse files
authored
Merge pull request #29 from cryo-zd/logs
chore: replace fmt.Printf with log.Printf for logging
2 parents 049e51b + a8bea08 commit 8e8c325

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/semantic-router/pkg/utils/http/response.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package http
33
import (
44
"encoding/json"
55
"fmt"
6+
"log"
67
"time"
78

89
core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
@@ -43,7 +44,7 @@ func CreatePIIViolationResponse(model string, deniedPII []string) *ext_proc.Proc
4344
responseBody, err := json.Marshal(openAIResponse)
4445
if err != nil {
4546
// Log the error and return a fallback response
46-
fmt.Printf("Error marshaling OpenAI response: %v\n", err)
47+
log.Printf("Error marshaling OpenAI response: %v", err)
4748
responseBody = []byte(`{"error": "Failed to generate response"}`)
4849
}
4950

@@ -106,7 +107,7 @@ func CreateJailbreakViolationResponse(jailbreakType string, confidence float32)
106107
responseBody, err := json.Marshal(openAIResponse)
107108
if err != nil {
108109
// Log the error and return a fallback response
109-
fmt.Printf("Error marshaling jailbreak response: %v\n", err)
110+
log.Printf("Error marshaling jailbreak response: %v", err)
110111
responseBody = []byte(`{"error": "Failed to generate response"}`)
111112
}
112113

0 commit comments

Comments
 (0)