2 |
## $Id$ |
## $Id$ |
3 |
## ------------------------------------------------------------------------ |
## ------------------------------------------------------------------------ |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.5 2003/05/13 08:40:15 joko |
6 |
|
## minor update: renamed attribute |
7 |
|
## |
8 |
|
## Revision 1.4 2003/03/29 07:16:00 joko |
9 |
|
## minor update: changed default log-file-name to 'perl_app.log' |
10 |
|
## |
11 |
|
## Revision 1.3 2003/03/28 07:23:25 joko |
12 |
|
## fix to basepath calculation |
13 |
|
## |
14 |
## Revision 1.2 2003/02/20 21:06:27 joko |
## Revision 1.2 2003/02/20 21:06:27 joko |
15 |
## + configurable by package globals |
## + configurable by package globals |
16 |
## + standalone mode (object creation via 'new') |
## + standalone mode (object creation via 'new') |
330 |
|
|
331 |
my $configurator = DesignPattern::Object->fromPackage('Log::Dispatch::Configurator::Hardwired'); |
my $configurator = DesignPattern::Object->fromPackage('Log::Dispatch::Configurator::Hardwired'); |
332 |
|
|
333 |
# FIXME? |
# check if running inside a 'PROJECT' space |
334 |
my $basepath = cwd() . '/..'; |
my $basepath = cwd(); |
335 |
|
my $postpone = '/..'; |
336 |
|
if (-d $basepath . $postpone . '/PROJECT') { |
337 |
|
$basepath .= $postpone; |
338 |
|
$basepath .= "/var/log"; |
339 |
|
} |
340 |
|
|
341 |
# configure custom logHandler |
# configure custom logHandler |
342 |
|
|
343 |
if ($configurator) { |
if ($configurator) { |
344 |
|
|
345 |
$configurator->{file_filename} = "$basepath/var/log/logfile.txt"; |
$configurator->{file_filename} = "$basepath/perl_app.log"; |
346 |
$configurator->{screen_min_level} = 'info'; |
$configurator->{screen_min_level} = 'info'; |
347 |
|
|
348 |
if ($self->{quiet}) { |
if ($self->{quiet}) { |
353 |
$configurator->{screen_min_level} = 'debug'; |
$configurator->{screen_min_level} = 'debug'; |
354 |
} |
} |
355 |
|
|
356 |
if ($self->{verbose}) { |
if ($self->{LOG_VERBOSE}) { |
357 |
$configurator->{verbose} = 1; |
$configurator->{verbose} = 1; |
358 |
} |
} |
359 |
|
|