This patch essentially introduces Perl bindings for snmplib/snmp_logging.c
.
Because of that, it could be considered a fix for:
It allows for:
my $log = SNMP::catch_log { $sess = SNMP::Session->new(DestHost => 'bogus'); }; printf "Logged error was: $log!\n";
Instead of the library printing to STDERR for us, we get this on STDOUT:
Logged error was: getaddrinfo: bogus Name or service not known!
(SNMP::catch_log is incidentally written in Perl using the new XS primitives _enable_log_callback
and _disable_log_callback
)
Oh, no. How embarrassing. Last minute I introduced a debugging sub. My bad. Here is the correct patch:
0001-Added-logging-primitives-to-perl-bindings-REMOVED_DEBUG_SUB.patch