--- nfo/perl/libs/DesignPattern/Object.pm 2003/02/19 00:36:59 1.8 +++ nfo/perl/libs/DesignPattern/Object.pm 2003/03/27 15:44:32 1.9 @@ -1,7 +1,10 @@ ## --------------------------------------------------------------------------- -## $Id: Object.pm,v 1.8 2003/02/19 00:36:59 joko Exp $ +## $Id: Object.pm,v 1.9 2003/03/27 15:44:32 joko Exp $ ## --------------------------------------------------------------------------- ## $Log: Object.pm,v $ +## Revision 1.9 2003/03/27 15:44:32 joko +## fixes/enhancements to 'sub log_basic' +## ## Revision 1.8 2003/02/19 00:36:59 joko ## + bugfix: this {logger} is the instance itself, so has to be fed with ( level => xyz and namespace => xyz ) ## + minor modifications in behaviour @@ -185,6 +188,9 @@ # object-creation my $object = $pkgname->new(@args); + # trace + #print Dumper($object); + # run boot-methods on object $object->_init() if $object->can('_init'); $object->constructor() if $object->can('constructor'); @@ -200,7 +206,15 @@ #return; $level ||= 'info'; - if ($_dp_globals->{TRACE} || ($level && $level =~ /warning|error|critical/)) { + my $notSoGood = ($level =~ /warning|error|critical/); + + # STDERR? + if ($level && $notSoGood) { + print STDERR $level, ": ", $message, "\n"; + } + + # STDOUT? + if ($_dp_globals->{TRACE} || $notSoGood) { print $level, ": ", $message, "\n"; }