Manager: reduce log level

This commit is contained in:
Sybren A. Stüvel 2022-05-06 14:35:27 +02:00
parent 72f1131e1c
commit 1fc71ccf92
3 changed files with 7 additions and 8 deletions

View File

@ -38,7 +38,7 @@ var (
// networkInterfaces returns a list of interface addresses. // networkInterfaces returns a list of interface addresses.
// Only those addresses that can be reached by a unicast TCP/IP connection are returned. // Only those addresses that can be reached by a unicast TCP/IP connection are returned.
func networkInterfaces() ([]net.IP, error) { 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() interfaces, err := net.Interfaces()
if err != nil { if err != nil {
@ -48,7 +48,7 @@ func networkInterfaces() ([]net.IP, error) {
usableAddresses := make([]net.IP, 0) usableAddresses := make([]net.IP, 0)
for _, iface := range interfaces { for _, iface := range interfaces {
if iface.Flags&net.FlagUp == 0 { 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 continue
} }
@ -79,11 +79,11 @@ func networkInterfaces() ([]net.IP, error) {
Logger() Logger()
switch { switch {
case ip.IsMulticast(): case ip.IsMulticast():
logger.Debug().Msg(" - skipping multicast") logger.Trace().Msg(" - skipping multicast")
case ip.IsUnspecified(): case ip.IsUnspecified():
logger.Debug().Msg(" - skipping unspecified") logger.Trace().Msg(" - skipping unspecified")
default: default:
logger.Debug().Msg(" - usable") logger.Trace().Msg(" - usable")
ifaceAddresses = append(ifaceAddresses, ip) ifaceAddresses = append(ifaceAddresses, ip)
} }
} }

View File

@ -58,7 +58,7 @@ func (s *Server) AddAdvertisement(serviceLocation string) {
MaxAge: 3600, // Number of seconds this advertisement is valid for. MaxAge: 3600, // Number of seconds this advertisement is valid for.
} }
s.ssdp.AdvertiseServer(serverDef) 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 // AddAdvertisementURLs constructs a service location from the given URLs, and

View File

@ -58,11 +58,10 @@ func (s *Store) createDirectoryStructure() {
path := filepath.Join(s.baseDir, subdir) path := filepath.Join(s.baseDir, subdir)
logger := log.With().Str("path", path).Logger() 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 err := os.MkdirAll(path, 0777); err != nil {
if os.IsExist(err) { if os.IsExist(err) {
logger.Trace().Msg("shaman: directory exists")
return return
} }
logger.Error().Err(err).Msg("shaman: unable to create directory") logger.Error().Err(err).Msg("shaman: unable to create directory")