| 2 |
## $Id$ |
## $Id$ |
| 3 |
## ------------------------------------------------------------------------ |
## ------------------------------------------------------------------------ |
| 4 |
## $Log$ |
## $Log$ |
| 5 |
|
## Revision 1.3 2003/03/28 07:23:25 joko |
| 6 |
|
## fix to basepath calculation |
| 7 |
|
## |
| 8 |
## Revision 1.2 2003/02/20 21:06:27 joko |
## Revision 1.2 2003/02/20 21:06:27 joko |
| 9 |
## + configurable by package globals |
## + configurable by package globals |
| 10 |
## + standalone mode (object creation via 'new') |
## + standalone mode (object creation via 'new') |
| 324 |
|
|
| 325 |
my $configurator = DesignPattern::Object->fromPackage('Log::Dispatch::Configurator::Hardwired'); |
my $configurator = DesignPattern::Object->fromPackage('Log::Dispatch::Configurator::Hardwired'); |
| 326 |
|
|
| 327 |
# FIXME? |
# check if running inside a 'PROJECT' space |
| 328 |
my $basepath = cwd() . '/..'; |
my $basepath = cwd(); |
| 329 |
|
my $postpone = '/..'; |
| 330 |
|
if (-d $basepath . $postpone . '/PROJECT') { |
| 331 |
|
$basepath .= $postpone; |
| 332 |
|
$basepath .= "/var/log"; |
| 333 |
|
} |
| 334 |
|
|
| 335 |
# configure custom logHandler |
# configure custom logHandler |
| 336 |
|
|
| 337 |
if ($configurator) { |
if ($configurator) { |
| 338 |
|
|
| 339 |
$configurator->{file_filename} = "$basepath/var/log/logfile.txt"; |
$configurator->{file_filename} = "$basepath/app.log"; |
| 340 |
$configurator->{screen_min_level} = 'info'; |
$configurator->{screen_min_level} = 'info'; |
| 341 |
|
|
| 342 |
if ($self->{quiet}) { |
if ($self->{quiet}) { |