Skip Menu |
 

This queue is for tickets about the Bot-BasicBot CPAN distribution.

Report information
The Basics
Id: 51804
Status: resolved
Priority: 0/
Queue: Bot-BasicBot

People
Owner: Nobody in particular
Requestors: MDOM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.81
Fixed in: (no value)



Subject: A warning is directly printed to stderr instead of using log()
Download (untitled) / with headers
text/plain 249b
Hi Tom, i just started to implement a more elaborate loggin scheme in B:BB:P and was very happy to find a log function in B:BB. But there's still one spot where a warning is directly printed to stderr. The attached patch solves this. Cheers, Mario
Subject: basicbot_logging.diff
--- /Users/dom/perl5/lib/perl5/Bot/BasicBot.pm 2009-01-26 10:15:25.000000000 +0100 +++ BasicBot.pm 2009-11-22 17:10:44.000000000 +0100 @@ -597,9 +597,12 @@ my $who = ( $args->{channel} eq "msg" ) ? $args->{who} : $args->{channel}; unless ( $who && $body ) { - print STDERR "Can't PRIVMSG without target and body\n"; - print STDERR " called from ".([caller]->[0])." line ".([caller]->[2])."\n"; - print STDERR " who = '$who'\n body = '$body'\n"; + $self->log( "Can't PRIVMSG without target and body\n" + . " called from " + . ( [caller]->[0] ) + . " line " + . ( [caller]->[2] ) . "\n" + . " who = '$who'\n body = '$body'\n" ); return; }
I have applied your patch. Thanks.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.