/[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.3 by ts-dev, Wed Dec 10 17:29:40 2003 UTC revision 1.4 by ts-dev, Wed Dec 10 18:13:28 2003 UTC
# Line 136  sub format_to_cb { Line 136  sub format_to_cb {
136              my $depth = 0;              my $depth = 0;
137              $depth++ while caller($depth) =~ /^Log::Dispatch/;              $depth++ while caller($depth) =~ /^Log::Dispatch/;
138              $depth += :Dispatch::Config::CallerDepth;              $depth += :Dispatch::Config::CallerDepth;
139              @p{qw(P F L S)} = caller($depth);              @p{qw(P F L)} = caller($depth);
140                my $subname = (caller($depth+1))[3];
141                $p{S} = $subname;
142                $subname =~ s/^.*:://;
143                $p{s} = $subname;
144          }          }
145    
146          my $log = $format;          my $log = $format;
147          $log =~ s{          $log =~ s{
148              (%d(?:{(.*?)})?)|   # $1: datetime $2: datetime fmt              (%d(?:{(.*?)})?)|   # $1: datetime $2: datetime fmt
149              (?:%([%pmFLPniS]))  # $3: others              (?:%([%pmFLPSnis])) # $3: others
150          }{          }{
151              if ($1 && $2) {              if ($1 && $2) {
152                  _strftime($2);                  _strftime($2);
# Line 264  C<format> defines log format. Possible c Line 268  C<format> defines log format. Possible c
268    %n    newline (\n)    %n    newline (\n)
269    %%    % itself    %%    % itself
270    %i    process-id, returns POSIX::getpid()    %i    process-id, returns POSIX::getpid()
271          %S  subroutine          %S  subroutine with package name
272            %s  subroutine without package name
273    
274  Note that datetime (%d) format is configurable by passing C<strftime>  Note that datetime (%d) format is configurable by passing C<strftime>
275  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.3  
changed lines
  Added in v.1.4

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