X-Git-Url: http://git.rot13.org/?p=virtual-ldap;a=blobdiff_plain;f=bin%2Fldap-koha.pl;h=30c2c9e003fb21f2f937480e88f9e2b5c67b755f;hp=e9ed1f997f5eedaed6ab9bf480741975a87a4440;hb=c004207348f0a98a6ed47d255eb20eae213c524f;hpb=495fb580ea5f2cb6e48eb2f1b10392b3f00125e9 diff --git a/bin/ldap-koha.pl b/bin/ldap-koha.pl index e9ed1f9..30c2c9e 100755 --- a/bin/ldap-koha.pl +++ b/bin/ldap-koha.pl @@ -8,6 +8,16 @@ use IO::Socket; use lib 'lib'; use LDAP::Koha; +my $debug = $ENV{DEBUG} || 0; + +BEGIN { + $SIG{'__WARN__'} = sub { + my $level = $1 if $_[0] =~ m/^(#+)/; + return if defined($level) && length($level) > $debug; + + warn join("\n", @_); + }; +} my $listen = shift @ARGV || 'localhost:2389'; my $sock = IO::Socket::INET->new(