add (working) dirk.pl + other bits
[dweather.git] / DWeather / lib / DWeather / Debug.pm
index bf815202b79d42cd0067f2c84883ea8197eb2140..d67b70221022d02e129858c3622c2d417f9ba5d0 100644 (file)
@@ -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