| 2 |
## $Id$ |
## $Id$ |
| 3 |
## --------------------------------------------------------------------------- |
## --------------------------------------------------------------------------- |
| 4 |
## $Log$ |
## $Log$ |
| 5 |
|
## Revision 1.9 2003/03/27 15:44:32 joko |
| 6 |
|
## fixes/enhancements to 'sub log_basic' |
| 7 |
|
## |
| 8 |
## Revision 1.8 2003/02/19 00:36:59 joko |
## Revision 1.8 2003/02/19 00:36:59 joko |
| 9 |
## + bugfix: this {logger} is the instance itself, so has to be fed with ( level => xyz and namespace => xyz ) |
## + bugfix: this {logger} is the instance itself, so has to be fed with ( level => xyz and namespace => xyz ) |
| 10 |
## + minor modifications in behaviour |
## + minor modifications in behaviour |
| 188 |
# object-creation |
# object-creation |
| 189 |
my $object = $pkgname->new(@args); |
my $object = $pkgname->new(@args); |
| 190 |
|
|
| 191 |
|
# trace |
| 192 |
|
#print Dumper($object); |
| 193 |
|
|
| 194 |
# run boot-methods on object |
# run boot-methods on object |
| 195 |
$object->_init() if $object->can('_init'); |
$object->_init() if $object->can('_init'); |
| 196 |
$object->constructor() if $object->can('constructor'); |
$object->constructor() if $object->can('constructor'); |
| 206 |
#return; |
#return; |
| 207 |
$level ||= 'info'; |
$level ||= 'info'; |
| 208 |
|
|
| 209 |
if ($_dp_globals->{TRACE} || ($level && $level =~ /warning|error|critical/)) { |
my $notSoGood = ($level =~ /warning|error|critical/); |
| 210 |
|
|
| 211 |
|
# STDERR? |
| 212 |
|
if ($level && $notSoGood) { |
| 213 |
|
print STDERR $level, ": ", $message, "\n"; |
| 214 |
|
} |
| 215 |
|
|
| 216 |
|
# STDOUT? |
| 217 |
|
if ($_dp_globals->{TRACE} || $notSoGood) { |
| 218 |
print $level, ": ", $message, "\n"; |
print $level, ": ", $message, "\n"; |
| 219 |
} |
} |
| 220 |
|
|