diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-01 18:43:39 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-01 18:43:39 -0600 |
commit | 795a0355a40293affc7164507e918440d4a828d6 (patch) | |
tree | 9724723196b77633801918030aa2e293dc8246fb /PerlTQt/lib/TQt/debug.pm | |
parent | 55e5c730361b5f2640f155aef4518ca69c4fc1b4 (diff) | |
download | libtqt-perl-795a0355a40293affc7164507e918440d4a828d6.tar.gz libtqt-perl-795a0355a40293affc7164507e918440d4a828d6.zip |
Move Qt
Diffstat (limited to 'PerlTQt/lib/TQt/debug.pm')
-rw-r--r-- | PerlTQt/lib/TQt/debug.pm | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/PerlTQt/lib/TQt/debug.pm b/PerlTQt/lib/TQt/debug.pm new file mode 100644 index 0000000..a0f4e19 --- /dev/null +++ b/PerlTQt/lib/TQt/debug.pm @@ -0,0 +1,36 @@ +package TQt::debug; +use TQt; + +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++; + } + } + TQt::_internal::setDebug($db); + print "Available channels: \n\t". + join("\n\t", sort keys %channel). + "\n" if $usage; +} + +sub unimport { + TQt::_internal::setDebug(0); +} + +1;
\ No newline at end of file |