#479 part 2, use debug logging instead of info (#480)

#479 part 2, use debug instead of info logging.

2 whitespace cleanups also included, as well as rewording props -> properties like in the rest of portproperties.pm
This commit is contained in:
nick n
2019-01-08 01:50:21 +01:00
committed by GitHub
parent 1b2592321d
commit 98a5e2c407
8 changed files with 21 additions and 23 deletions

View File

@@ -30,7 +30,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
foreach my $idx (keys %$raw_speed) {
my $port = $interfaces->{$idx} or next;
if (!defined $device_ports->{$port}) {
info sprintf ' [%s] properties/speed - local port %s not in database!',
debug sprintf ' [%s] properties/speed - local port %s already skipped, ignoring',
$device->ip, $port;
next;
}
@@ -43,7 +43,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
foreach my $idx (keys %$err_cause) {
my $port = $interfaces->{$idx} or next;
if (!defined $device_ports->{$port}) {
info sprintf ' [%s] properties/errdis - local port %s not in database!',
debug sprintf ' [%s] properties/errdis - local port %s already skipped, ignoring',
$device->ip, $port;
next;
}
@@ -56,7 +56,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
foreach my $idx (keys %$faststart) {
my $port = $interfaces->{$idx} or next;
if (!defined $device_ports->{$port}) {
info sprintf ' [%s] properties/faststart - local port %s not in database!',
debug sprintf ' [%s] properties/faststart - local port %s already skipped, ignoring',
$device->ip, $port;
next;
}
@@ -77,7 +77,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
foreach my $idx (keys %$c_if) {
my $port = $interfaces->{ $c_if->{$idx} } or next;
if (!defined $device_ports->{$port}) {
info sprintf ' [%s] properties/lldpcap - local port %s not in database!',
debug sprintf ' [%s] properties/lldpcap - local port %s already skipped, ignoring',
$device->ip, $port;
next;
}
@@ -106,12 +106,12 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
schema('netdisco')->txn_do(sub {
my $gone = $device->properties_ports->delete;
debug sprintf ' [%s] props - removed %d ports with properties',
debug sprintf ' [%s] properties - removed %d ports with properties',
$device->ip, $gone;
$device->properties_ports->populate(
[map {{ port => $_, %{ $properties{$_} } }} keys %properties] );
return Status->info(sprintf ' [%s] props - added %d new port properties',
return Status->info(sprintf ' [%s] properties - added %d new port properties',
$device->ip, scalar keys %properties);
});
});