File: debug.mpi

package info (click to toggle)
madoka 4.1.15-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 792 kB
  • ctags: 43
  • sloc: perl: 1,140; makefile: 42
file content (37 lines) | stat: -rw-r--r-- 810 bytes parent folder | download
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
# madoka 4.1 rc_debug
#
# rc/debug.mpi
#    Copyright(c)1998- cookie / The madoka project
#

&list_add($plugin_list, 'debug');
&redo('debug.mpi');

$log_name{'D'} = 'dbg%M%D';
$log_handle{'D'} = 'L2';
$debug = 1;

local($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'};
  }
} elsif ($var eq 'logfile') {
  $arg =~ s/^~/$homedir/;
  $log_name{'D'} = $arg;
  local($l);
  while ($arg =~ /%(.)/) {
    $l = $1;
    &down("[ERROR] wrong logfile format in [debug]")
	if $l !~ /^[YyMDhms]$/;
    $arg =~ s/%$l//;
  }
  foreach (keys(%log_name)) {
    $log_handle{'D'} = $log_handle{$_}
      if $log_name{'D'} eq $log_name{$_};
  }
}