You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
698 B
36 lines
698 B
13 years ago
|
package TQt::debug;
|
||
|
use TQt;
|
||
13 years ago
|
|
||
|
our %channel = (
|
||
|
'ambiguous' => 0x01,
|
||
|
'autoload' => 0x02,
|
||
|
'calls' => 0x04,
|
||
|
'gc' => 0x08,
|
||
|
'virtual' => 0x10,
|
||
|
'verbose' => 0x20,
|
||
|
'all' => 0xffff
|
||
|
);
|
||
|
|
||
|
sub import {
|
||
|
shift;
|
||
|
my $db = (@_)? 0x0000 : (0x01|0x20);
|
||
|
my $usage = 0;
|
||
|
for my $ch(@_) {
|
||
|
if( exists $channel{$ch}) {
|
||
|
$db |= $channel{$ch};
|
||
|
} else {
|
||
|
warn "Unknown debugging channel: $ch\n";
|
||
|
$usage++;
|
||
|
}
|
||
|
}
|
||
13 years ago
|
TQt::_internal::setDebug($db);
|
||
13 years ago
|
print "Available channels: \n\t".
|
||
|
join("\n\t", sort keys %channel).
|
||
|
"\n" if $usage;
|
||
|
}
|
||
|
|
||
|
sub unimport {
|
||
13 years ago
|
TQt::_internal::setDebug(0);
|
||
13 years ago
|
}
|
||
|
|
||
|
1;
|