From 53184a6bcaf516652c7033c1af445d488e62c49a Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Tue, 24 Feb 2026 22:12:30 +0100 Subject: [PATCH] reduce log noise --- cmd/soundtouch-service/main.go | 8 +++----- pkg/service/handlers/server.go | 15 +++++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/cmd/soundtouch-service/main.go b/cmd/soundtouch-service/main.go index f931fa1..0af013d 100644 --- a/cmd/soundtouch-service/main.go +++ b/cmd/soundtouch-service/main.go @@ -800,14 +800,14 @@ func setupRouter(server *handlers.Server) *chi.Mux { func startHTTPSServer(httpsAddr string, r http.Handler, tlsConfig *tls.Config, httpsServerURL string) { // Add custom error logging and connection state tracking tlsConfig.GetCertificate = func(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) { - log.Printf("[TLS] Certificate request for ServerName: %s", clientHello.ServerName) + // log.Printf("[TLS] Certificate request for ServerName: %s", clientHello.ServerName) // Use the default certificate selection logic for _, cert := range tlsConfig.Certificates { if cert.Leaf != nil { for _, name := range cert.Leaf.DNSNames { if matchesDomain(name, clientHello.ServerName) { - log.Printf("[TLS] ✅ Serving certificate for %s (matched %s)", clientHello.ServerName, name) + // log.Printf("[TLS] ✅ Serving certificate for %s (matched %s)", clientHello.ServerName, name) return &cert, nil } } @@ -816,7 +816,7 @@ func startHTTPSServer(httpsAddr string, r http.Handler, tlsConfig *tls.Config, h // If no specific match, return the first certificate and log it if len(tlsConfig.Certificates) > 0 { - log.Printf("[TLS] ⚠️ No exact match for %s, using default certificate", clientHello.ServerName) + // log.Printf("[TLS] ⚠️ No exact match for %s, using default certificate", clientHello.ServerName) return &tlsConfig.Certificates[0], nil } @@ -922,8 +922,6 @@ func (c *loggingTLSConn) Read(b []byte) (n int, err error) { strings.Contains(err.Error(), "certificate") { log.Printf("[TLS] ❌ Handshake failed from %s: %v", c.addr, err) } - } else if n > 0 { - log.Printf("[TLS] ✅ Successful connection from %s", c.addr) } } diff --git a/pkg/service/handlers/server.go b/pkg/service/handlers/server.go index 169e625..858ec99 100644 --- a/pkg/service/handlers/server.go +++ b/pkg/service/handlers/server.go @@ -705,14 +705,13 @@ func (s *Server) findExistingDeviceID(d models.DiscoveredDevice) string { // findAllExistingDeviceVariants finds all existing device entries that could represent the same physical device func (s *Server) findAllExistingDeviceVariants(d models.DiscoveredDevice, liveInfo *setup.DeviceInfoXML) []models.ServiceDeviceInfo { - log.Printf("Searching for existing device variants with criteria:") - log.Printf(" Discovery IP: %s", d.Host) - log.Printf(" Discovery Serial: %s", d.SerialNo) - log.Printf(" Live Info Serial: %s", liveInfo.SerialNumber) - log.Printf(" Live Info Name: %s", liveInfo.Name) - log.Printf(" Live Info MAC: %s", liveInfo.GetPrimaryMacAddress()) - log.Printf(" Live Info Product: %s %s", liveInfo.Type, liveInfo.ModuleType) - + // log.Printf("Searching for existing device variants with criteria:") + // log.Printf(" Discovery IP: %s", d.Host) + // log.Printf(" Discovery Serial: %s", d.SerialNo) + // log.Printf(" Live Info Serial: %s", liveInfo.SerialNumber) + // log.Printf(" Live Info Name: %s", liveInfo.Name) + // log.Printf(" Live Info MAC: %s", liveInfo.GetPrimaryMacAddress()) + // log.Printf(" Live Info Product: %s %s", liveInfo.Type, liveInfo.ModuleType) allDevices, err := s.ds.ListAllDevices() if err != nil { return nil