aboutsummaryrefslogtreecommitdiff
path: root/Plugin/Log.pm
blob: 8f9982f0f214eca5d5d5360444942bed80c69ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package Plugin::Log;

use strict;
use warnings;

my $config;
my $root_config;

sub configure {
	my $self = shift;
	shift; # cmdref
	shift; # run_command
	$config = shift;
	$root_config = shift;

	return $self;
}

sub on_message {
	my ($self, $logger, $who, $where, $raw_what, $what, $irc) = @_;
	$logger->("[$where->[0]] $who: $raw_what");
	return;
}

sub on_action {
	my ($self, $logger, $who, $where, $raw_what, $what, $irc) = @_;
	$logger->("[$where->[0]] * $who $raw_what");
	return;
}

sub on_part {
	my ($self, $logger, $who, $where, $why, $irc) = @_;
	$logger->("[$where] --- $who left ($why)");
	return;
}

sub on_join {
	my ($self, $logger, $who, $where, $irc) = @_;
	$logger->("[$where] --- $who joined");
	return;
}

sub on_kick {
	my ($self, $logger, $kicker, $where, $kickee, $why, $irc) = @_;
	$logger->("[$where] !!! $kicker kicked $kickee ($why)");
	return;
}

sub on_nick {
	my ($self, $logger, $who, $new_nick, $irc) = @_;
	$logger->("$who changed nick to $new_nick");
	return;
}

sub on_invite {
	my ($self, $logger, $who, $where, $irc) = @_;
	$logger->("$who invited me to join $where");
	return;
}
1;