FQStat/Debug.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 38 CC 1 SCAR 6.9
CC
1
Cov
0%
warnline
2.0
warnenter
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package App::FQStat::Debug;
3 # App::FQStat is (c) 2007-2009 Steffen Mueller
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the same terms as Perl itself.
7  
8 use strict;
9 use warnings;
10 use Time::HiRes qw/time/;
11 use App::FQStat::Debug;
12  
13 use base 'Exporter';
14 our %EXPORT_TAGS = (
15 'all' => [qw(
16 warnline
17 warnenter
18 )],
19 );
20 our @EXPORT_OK = @{$EXPORT_TAGS{'all'}};
21 our @EXPORT = @{$EXPORT_TAGS{'all'}};
22  
23 sub warnline ($) {
24 my $msg = shift;
25 chomp($msg);
26 my $time = time();
27 my ($pkg, $file, $line) = caller();
28 ::debug( sprintf("[% 6.2f]", $time - &::STARTTIME()) . " $msg at $file line $line\n" );
29 }
30  
31 sub warnenter () {
32 my $time = time();
33 my ($fpkg, $ffile, $fline, $sub) = caller(1);
34 ::debug( sprintf("[% 6.2f]", $time - &::STARTTIME()) . " Entering $sub from $ffile line $fline\n" );
35 }
36  
37 1;
38