From 1fc71ccf925444ada06cf4c29fa1ef655ec1468f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 6 May 2022 14:35:27 +0200 Subject: [PATCH] Manager: reduce log level --- internal/own_url/interfaces.go | 10 +++++----- internal/upnp_ssdp/server.go | 2 +- pkg/shaman/filestore/filestore.go | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/internal/own_url/interfaces.go b/internal/own_url/interfaces.go index a9a60642..e0656405 100644 --- a/internal/own_url/interfaces.go +++ b/internal/own_url/interfaces.go @@ -38,7 +38,7 @@ var ( // networkInterfaces returns a list of interface addresses. // Only those addresses that can be reached by a unicast TCP/IP connection are returned. func networkInterfaces() ([]net.IP, error) { - log.Debug().Msg("iterating over all network interfaces") + log.Trace().Msg("iterating over all network interfaces") interfaces, err := net.Interfaces() if err != nil { @@ -48,7 +48,7 @@ func networkInterfaces() ([]net.IP, error) { usableAddresses := make([]net.IP, 0) for _, iface := range interfaces { if iface.Flags&net.FlagUp == 0 { - log.Debug().Str("interface", iface.Name).Msg("skipping down interface") + log.Trace().Str("interface", iface.Name).Msg("skipping down interface") continue } @@ -79,11 +79,11 @@ func networkInterfaces() ([]net.IP, error) { Logger() switch { case ip.IsMulticast(): - logger.Debug().Msg(" - skipping multicast") + logger.Trace().Msg(" - skipping multicast") case ip.IsUnspecified(): - logger.Debug().Msg(" - skipping unspecified") + logger.Trace().Msg(" - skipping unspecified") default: - logger.Debug().Msg(" - usable") + logger.Trace().Msg(" - usable") ifaceAddresses = append(ifaceAddresses, ip) } } diff --git a/internal/upnp_ssdp/server.go b/internal/upnp_ssdp/server.go index a2b9b9da..6d26ecdb 100644 --- a/internal/upnp_ssdp/server.go +++ b/internal/upnp_ssdp/server.go @@ -58,7 +58,7 @@ func (s *Server) AddAdvertisement(serviceLocation string) { MaxAge: 3600, // Number of seconds this advertisement is valid for. } s.ssdp.AdvertiseServer(serverDef) - s.log.Info().Str("location", serviceLocation).Msg("UPnP/SSDP location registered") + s.log.Debug().Str("location", serviceLocation).Msg("UPnP/SSDP location registered") } // AddAdvertisementURLs constructs a service location from the given URLs, and diff --git a/pkg/shaman/filestore/filestore.go b/pkg/shaman/filestore/filestore.go index e0e84b90..8f1ee0f7 100644 --- a/pkg/shaman/filestore/filestore.go +++ b/pkg/shaman/filestore/filestore.go @@ -58,11 +58,10 @@ func (s *Store) createDirectoryStructure() { path := filepath.Join(s.baseDir, subdir) logger := log.With().Str("path", path).Logger() - logger.Debug().Msg("shaman: creating directory") + logger.Trace().Msg("shaman: ensuring directory exists") if err := os.MkdirAll(path, 0777); err != nil { if os.IsExist(err) { - logger.Trace().Msg("shaman: directory exists") return } logger.Error().Err(err).Msg("shaman: unable to create directory")