NAME

Log.pm A module to provide logging methods for IRC::Bot

SYNOPSIS

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" );

}

DESCRIPTION

Provides logging functionality for an IRC bot.

METHODS

  1. bot_log() logs private messages to the bot

    Use like so:

    $log->bot_log( "Lamer tried to access me!\n" );
  2. serv_log() Logs server events like disconnects, connects, connection errors and such.

  3. chan_log() Logs channel activity, just about everything.

    Use like so:

    $log->chan_log( "$nick joined $channel\n" );
  4. 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

    Use like so:

    $log->clear_log("Bot");

AUTHOR

Benjamin Smith (DeFyance) defyance@just-another.net

SEE ALSO

POE::Component::IRC