From 5cc8513322a3e604ae31d2c15ca7902608dfbfb8 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Wed, 16 Oct 2019 12:03:51 +0300 Subject: [PATCH] * use debug log level for unimportant messages --- home/clients.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/home/clients.go b/home/clients.go index 69534dba..eacdadb9 100644 --- a/home/clients.go +++ b/home/clients.go @@ -376,7 +376,7 @@ func (clients *clientsContainer) addFromHostsFile() { } } - log.Info("Added %d client aliases from %s", n, hostsFn) + log.Debug("Added %d client aliases from %s", n, hostsFn) } // Add IP -> Host pairs from the system's `arp -a` command output @@ -422,18 +422,23 @@ func (clients *clientsContainer) addFromSystemARP() { } } - log.Info("Added %d client aliases from 'arp -a' command output", n) + log.Debug("Added %d client aliases from 'arp -a' command output", n) } // add clients from DHCP that have non-empty Hostname property func (clients *clientsContainer) addFromDHCP() { leases := config.dhcpServer.Leases() + n := 0 for _, l := range leases { if len(l.Hostname) == 0 { continue } - _, _ = config.clients.AddHost(l.IP.String(), l.Hostname, ClientSourceDHCP) + ok, _ := config.clients.AddHost(l.IP.String(), l.Hostname, ClientSourceDHCP) + if ok { + n++ + } } + log.Debug("Added %d client aliases from DHCP", n) } type clientHostJSON struct {