--- nfo/perl/libs/DesignPattern/Object.pm 2003/02/19 00:36:59 1.8 +++ nfo/perl/libs/DesignPattern/Object.pm 2003/05/13 08:46:08 1.10 @@ -1,7 +1,13 @@ ## --------------------------------------------------------------------------- -## $Id: Object.pm,v 1.8 2003/02/19 00:36:59 joko Exp $ +## $Id: Object.pm,v 1.10 2003/05/13 08:46:08 joko Exp $ ## --------------------------------------------------------------------------- ## $Log: Object.pm,v $ +## Revision 1.10 2003/05/13 08:46:08 joko +## pod and comments +## +## 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 @@ -29,6 +35,19 @@ ## ## --------------------------------------------------------------------------- +=pod + +=head1 NAME + + DesignPattern::Object + + +=head1 TODO + + o use Class::Loader + + +=cut package DesignPattern::Object; @@ -165,6 +184,7 @@ eval($evstring); # report errors + # Could this be united with DesignPattern::Loader::checkExceptions? if ($@) { # build error-messages my $issuer = __PACKAGE__ . ':' . __LINE__; @@ -185,6 +205,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 +223,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"; }