Hi all!!
I'm making a bot using perl with POE::Component::IRC , and for now all is well. But I have a problem with the logger pluggin of POE
I've been documenting for pluggins, and I have no problem with others, but this fails.And apparently not output any error.
Only i have problem when i dont use 'Path'.
I publish my code, maybe someone has a solution or tell me how to find the solution.
Data:
Perl Version: 5.10.0-19
POE Version: 6.09
#!/usr/bin/perl
use strict;
use warnings;
use POE qw(Component::IRC);
use POE::Component::IRC::Plugin::BotTraffic;
use POE::Component::IRC::Plugin::Logger;
my $nickname = 'Fulgor101';
my $ircname = 'Observando';
my $server = 'dune.irc-hispano.org';
my $username = 'Fulgor';
my @channels = ('#pruebas');
# We create a new PoCo-IRC object
my $irc = POE::Component::IRC->spawn(
nick => $nickname,
ircname => $ircname,
username => $username,
server => $server,
) or die "Oh noooo! $!";
POE::Session->create(
package_states => [
main => [ qw(_default _start irc_001 irc_public irc_bot_publi
+c) ],
],
heap => { irc => $irc },
);
sub _start {
my $heap = $_[HEAP];
# retrieve our component's object from the heap where we stashed
+it
my $irc = $heap->{irc};
$irc->yield( register => 'all' );
$irc->yield( connect => { } );
$irc->plugin_add( 'BotTraffic', POE::Component::IRC::Plugin::BotT
+raffic->new() );
$irc->plugin_add('Logger', POE::Component::IRC::Plugin::Logger->n
+ew(Path =>'home/user',Private => 1,Public => 1,DCC => 1, ));
return;
}
.
.
.
sub irc_bot_public {
my ($kernel, $heap) = @_[KERNEL, HEAP];
my $channel = $_[ARG0]->[0];
my $what = $_[ARG1];
print "I said '$what' on channel $channel\n";
return;
}
After launching it, everything it's ok, the BotTraffic run perfectly. And 'Logger' pluggin, gives no error when loading.
Lines that appear when launching the script.
user@Box:~$ perl 3cosa.pl
irc_registered: 'POE::Component::IRC=HASH(0x86873c0)'
irc_plugin_add: 'BotTraffic' 'POE::Component::IRC::Plugin::BotTraffic
+=HASH(0x86982d8)'
irc_plugin_add: 'Logger' 'POE::Component::IRC::Plugin::Logger=HASH(0x
+86522b8)'
irc_connected: 'dune.irc-hispano.org'
irc_notice: 'dune.irc-hispano.org' [IP_LOOKUP] '*** Found your hostna
+me (CACHED!).'
irc_ping: 'eMa8oAUCf6UWWOKo'
Connected to dune.irc-hispano.org
irc_002: 'dune.irc-hispano.org' 'Your host is dune.irc-hispano.org, r
+unning version u2.10.H.10.110' [Your host is dune.irc-hispano.org, ru
+nning version u2.10.H.10.110]
irc_003: 'dune.irc-hispano.org' 'This server was created lun mar 2 20
+09 at 13:47:21 CET' [This server was created lun mar 2 2009 at 13:47:
+21 CET]
.
.
.
And I have tried different routes in the variable 'Path', and i revised the permits ... and nothing, they was ok. But nothing, the log not create.
I can not think of anything ... something is beyond me and not that, maybe someone see something more ...
A greeting and thanks
PD<> Sorry for my poor english