129 |
$p{m} = delete $p{message}; |
$p{m} = delete $p{message}; |
130 |
$p{n} = "\n"; |
$p{n} = "\n"; |
131 |
$p{'%'} = '%'; |
$p{'%'} = '%'; |
132 |
|
require POSIX; |
133 |
|
$p{i} = POSIX::getpid(); |
134 |
|
|
135 |
if ($needs_caller) { |
if ($needs_caller) { |
136 |
my $depth = 0; |
my $depth = 0; |
142 |
my $log = $format; |
my $log = $format; |
143 |
$log =~ s{ |
$log =~ s{ |
144 |
(%d(?:{(.*?)})?)| # $1: datetime $2: datetime fmt |
(%d(?:{(.*?)})?)| # $1: datetime $2: datetime fmt |
145 |
(?:%([%pmFLPn])) # $3: others |
(?:%([%pmFLPni])) # $3: others |
146 |
}{ |
}{ |
147 |
if ($1 && $2) { |
if ($1 && $2) { |
148 |
_strftime($2); |
_strftime($2); |
263 |
%P package |
%P package |
264 |
%n newline (\n) |
%n newline (\n) |
265 |
%% % itself |
%% % itself |
266 |
|
%i process-id, returns POSIX::getpid() |
267 |
|
|
268 |
Note that datetime (%d) format is configurable by passing C<strftime> |
Note that datetime (%d) format is configurable by passing C<strftime> |
269 |
fmt in braket after %d. (I know it looks quite messy, but its |
fmt in braket after %d. (I know it looks quite messy, but its |