diff --git a/.golangci.yaml b/.golangci.yaml index 9badf166d1..14f42f9c19 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -38,6 +38,15 @@ linters: deny: - pkg: "math/rand$" desc: "use math/rand/v2 instead of math/rand" + no-stdlib-log: + files: + - "**" + - "!**/bundle/docsgen/**" + - "!**/bundle/internal/schema/**" + - "!**/bundle/internal/validation/**" + deny: + - pkg: "log$" + desc: "use libs/log instead of the standard library log package" forbidigo: forbid: - pattern: 'term\.IsTerminal' diff --git a/libs/appproxy/appproxy.go b/libs/appproxy/appproxy.go index a1b4adfc68..d1d7c5c9df 100644 --- a/libs/appproxy/appproxy.go +++ b/libs/appproxy/appproxy.go @@ -3,11 +3,12 @@ package appproxy import ( "context" "io" - "log" "net" "net/http" "net/url" "strings" + + "github.com/databricks/cli/libs/log" ) type Proxy struct { @@ -122,7 +123,7 @@ func (p *Proxy) handleWebSocket(w http.ResponseWriter, r *http.Request) { // If the error is not EOF, then there was a problem if err != io.EOF { // Log the error and perform cleanup - log.Printf("Error copying messages: %v", err) + log.Warnf(r.Context(), "error copying messages: %v", err) middlewareConn.Close() targetServerConn.Close() }