The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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

bot_log()

bot_log() logs private messages to the bot

Use like so:

 $log->bot_log( "Lamer tried to access me!\n" );
serv_log()

serv_log() Logs server events like disconnects, connects, connection errors and such.

Use like so:

 $log->serv_log( "Connected.." );
 
chan_log()

chan_log() Logs channel activity, just about everything.

Use like so:

 $log->chan_log( "$nick joined $channel\n" );
clear_log()

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

CREDITS

See IRC::Bot

AUTHOR

Benjamin Smith defitro@just-another.net

SEE ALSO

IRC::Bot POE::Component::IRC