From 050de1a0b369e33f259c03a2986da79faec2a0cd Mon Sep 17 00:00:00 2001 From: ycc Date: Wed, 5 Jun 2024 21:31:34 +0200 Subject: [PATCH] clean logwriter --- lokiwriter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lokiwriter.go b/lokiwriter.go index fa817c9..7afecf1 100644 --- a/lokiwriter.go +++ b/lokiwriter.go @@ -74,7 +74,7 @@ func (w *LokiWriter) Write(p []byte) (n int, err error) { return 0, fmt.Errorf("failed to marshal payload: %w", err) } - fmt.Printf("Sending payload to Loki: %s\n", string(payloadBytes)) + //fmt.Printf("Sending payload to Loki: %s\n", string(payloadBytes)) req, err := http.NewRequest("POST", w.url, bytes.NewReader(payloadBytes)) if err != nil { @@ -88,7 +88,7 @@ func (w *LokiWriter) Write(p []byte) (n int, err error) { } defer resp.Body.Close() - fmt.Printf("Loki response status: %d\n", resp.StatusCode) + //fmt.Printf("Loki response status: %d\n", resp.StatusCode) if resp.StatusCode != http.StatusNoContent { return 0, fmt.Errorf("received non-204 response from Loki: %d", resp.StatusCode) }