X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=DWeather%2Flib%2FDWeather%2FDebug.pm;h=d67b70221022d02e129858c3622c2d417f9ba5d0;hb=b3376c44ca26ef6b330994bcbeea40d3ae9166de;hp=bf815202b79d42cd0067f2c84883ea8197eb2140;hpb=dc4a7b485f2c395471e3f7b64667da3625dcdc64;p=dweather.git diff --git a/DWeather/lib/DWeather/Debug.pm b/DWeather/lib/DWeather/Debug.pm index bf81520..d67b702 100644 --- a/DWeather/lib/DWeather/Debug.pm +++ b/DWeather/lib/DWeather/Debug.pm @@ -10,7 +10,7 @@ # modify it under the same terms as Perl itself. # -package Debug; +package DWeather::Debug; require Exporter; @ISA = qw(Exporter); @@ -20,7 +20,7 @@ $VERSION = sprintf( "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/ ); use strict; use vars qw(%dbglevel $fp); -use SMGLog (); +use DWeather::Logger; use Carp qw(cluck); %dbglevel = (); @@ -52,8 +52,6 @@ if (!defined $DB::VERSION) { ); } -dbginit(); - sub dbg { my $t = time; @@ -63,7 +61,7 @@ sub dbg chomp $r; my @l = split /\n/, $r; for (@l) { - s/([\x00-\x08\x0B-\x1f\x7f-\xff])/uc sprintf("%%%02x",ord($1))/eg; + s/([\x00-\x1f\x7f-\xff])/uc sprintf("%%%02x",ord($1))/eg; # print "$_\n" if defined \*STDOUT; $fp->writeunix($t, "$ts $_"); } @@ -78,7 +76,7 @@ sub dbginit $SIG{__DIE__} = sub { dbg($@, Carp::longmess(@_)); }; } - $fp = SMGLog->new('debug', 'dat', 'd'); + $fp = DWeather::Logger->new('debug', 'log', 'd') unless $fp; } sub dbgclose