11 |
11 |
use constant REQUEST => 1 << 7;
|
12 |
12 |
use constant WARN => 1 << 8;
|
13 |
13 |
use constant TRACE2 => 1 << 9;
|
14 |
|
use constant ALL => (1 << 10) - 1;
|
|
14 |
use constant SHOW_CALLER => 1 << 10;
|
|
15 |
use constant ALL => (1 << 11) - 1;
|
15 |
16 |
use constant DEVEL => INFO | DEBUG1 | QUERY | TRACE | BACKTRACE_ON_ERROR | REQUEST_TIMER;
|
16 |
17 |
|
17 |
18 |
use constant FILE_TARGET => 0;
|
... | ... | |
144 |
145 |
no warnings;
|
145 |
146 |
my ($self, $level, $message) = @_;
|
146 |
147 |
|
147 |
|
$self->_write(level2string($level), $message) if (($self->{"level"} | $global_level) & $level || !$level);
|
|
148 |
my $show_caller = ($level | $global_level) & SHOW_CALLER();
|
|
149 |
$level &= ~SHOW_CALLER();
|
|
150 |
|
|
151 |
$self->_write(level2string($level), $message, show_caller => $show_caller) if (($self->{"level"} | $global_level) & $level || !$level);
|
148 |
152 |
}
|
149 |
153 |
sub warn {
|
150 |
154 |
no warnings;
|
... | ... | |
260 |
264 |
|
261 |
265 |
sub _write {
|
262 |
266 |
no warnings;
|
263 |
|
my ($self, $prefix, $message) = @_;
|
|
267 |
my ($self, $prefix, $message, %options) = @_;
|
|
268 |
|
|
269 |
my @prefixes = ($prefix);
|
|
270 |
|
|
271 |
if ($options{show_caller}) {
|
|
272 |
my ($package, $filename, $line, $subroutine) = caller(1);
|
|
273 |
push @prefixes, "${filename}:${line}";
|
|
274 |
}
|
|
275 |
|
|
276 |
$prefix = join ' ', grep { $_ } @prefixes;
|
|
277 |
|
264 |
278 |
my @now = gettimeofday();
|
265 |
279 |
my $date = strftime("%Y-%m-%d %H:%M:%S." . sprintf('%03d', int($now[1] / 1000)) . " $$ [" . getpid() . "] ${prefix}: ", localtime($now[0]));
|
266 |
280 |
local *FILE;
|
LXDebug: Flag SHOW_CALLER für Ausgabe Dateiname:Zeilennummer bei message() & dump()