/[cvs]/nfo/perl/libs/Log/Dispatch/Config.pm
ViewVC logotype

Diff of /nfo/perl/libs/Log/Dispatch/Config.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Fri Dec 5 16:18:45 2003 UTC revision 1.2 by joko, Fri Dec 5 18:04:15 2003 UTC
# Line 129  sub format_to_cb { Line 129  sub format_to_cb {
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;
# Line 140  sub format_to_cb { Line 142  sub format_to_cb {
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);
# Line 261  C<format> defines log format. Possible c Line 263  C<format> defines log format. Possible c
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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed