315 |
$webpac->_init_logger('/path/to/log.conf'); |
$webpac->_init_logger('/path/to/log.conf'); |
316 |
|
|
317 |
If no path to configuration file is given, dummy empty configuration |
If no path to configuration file is given, dummy empty configuration |
318 |
will be create. |
will be created. If any mode which inherits from this one is called |
319 |
|
with C<debug> flag, it will turn logging to debug level. |
320 |
|
|
321 |
=cut |
=cut |
322 |
|
|
327 |
Log::Log4perl->init($file); |
Log::Log4perl->init($file); |
328 |
} else { |
} else { |
329 |
my $conf = q( ); |
my $conf = q( ); |
330 |
|
if ($self->{'debug'}) { |
331 |
|
$conf = << '_log4perl_'; |
332 |
|
|
333 |
|
log4perl.rootLogger=INFO, SCREEN |
334 |
|
|
335 |
|
log4perl.logger.WebPAC.=DEBUG |
336 |
|
|
337 |
|
log4perl.appender.SCREEN=Log::Log4perl::Appender::Screen |
338 |
|
log4perl.appender.SCREEN.layout=PatternLayout |
339 |
|
log4perl.appender.SCREEN.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n |
340 |
|
|
341 |
|
_log4perl_ |
342 |
|
} |
343 |
Log::Log4perl->init( \$conf ); |
Log::Log4perl->init( \$conf ); |
344 |
} |
} |
345 |
} |
} |