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
|
# madoka 4.2 rc_debug
#
# rc/debug.mpi
# Copyright(c)1998- cookie / The madoka project
#
&list_add($plugin_list, 'debug');
&redo('debug.mpi');
$log_name{'D'} = ['debug%M%D'] unless $log_name{'D'};
$log_handle{'D'} = ['L2'];
$log_code{'D'} = [''];
$log_mode{'D'} = [0600];
$debug = 1;
my($var, $arg) = split(/=\s*/, $rc_line, 2);
if ($var eq 'mode') {
if ($arg eq 'on' || $arg eq '+') {
$debug = 1;
} elsif ($arg eq 'off' || $arg eq '-') {
$debug = 0;
delete $log_name{'D'};
delete $log_handle{'D'};
delete $log_mode{'D'};
}
} elsif ($var eq 'logfile') {
$arg =~ s/^~/$homedir/;
$log_name{'D'} = [$arg];
my $l;
while ($arg =~ /%(.)/) {
$l = $1;
&down("[ERROR] wrong logfile format in [debug]")
if $l !~ /^[YyMDh]$/;
$arg =~ s/%$l//;
}
foreach (keys(%log_name)) {
next if $_ eq 'D';
for ($i = 0; $i <= $#{$log_name{$_}}; $i++) {
${$log_handle{'D'}}[0] = ${$log_handle{$_}}[$i]
if ${$log_name{'D'}}[0] = ${$log_name{$_}}[$i];
last;
}
}
}
|