Log.pm A module to provide logging methods for IRC::Bot.
use Irc::Bot::Log; my $log = Irc::Bot::Log->new( Path => '/path/to/logdir/' ); # later on... # Log join event, assuming Poe::Component::IRC use.. sub on_join { my ( $kernel, $who, $where ) = @_[ KERNEL, ARG0, ARG1 ]; my $nick = ( split /!/, $who )[0]; # Do Stuff... $log->chan_log( "$nick has joined $where\n" ); }
Provides logging functionality for an IRC bot.
bot_log() logs private messages to the bot
Use like so:
$log->bot_log( "Lamer tried to access me!\n" );
serv_log() Logs server events like disconnects, connects, connection errors and such.
$log->serv_log( "Connected.." );
chan_log() Logs channel activity, just about everything.
$log->chan_log( "$nick joined $channel\n" );
clear_log() clears the specified log file. Arguments are:
Bot for bot.log Server for server.log Channel for chan.log All to clear all the logs
$log->clear_log("Bot");
See IRC::Bot
Benjamin Smith defitro@just-another.net
IRC::Bot POE::Component::IRC
To install IRC::Bot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IRC::Bot
CPAN shell
perl -MCPAN -e shell install IRC::Bot
For more information on module installation, please visit the detailed CPAN module installation guide.