--- nfo/perl/libs/Log/Dispatch/Config.pm 2003/12/10 17:29:40 1.3 +++ nfo/perl/libs/Log/Dispatch/Config.pm 2003/12/10 18:13:28 1.4 @@ -136,13 +136,17 @@ my $depth = 0; $depth++ while caller($depth) =~ /^Log::Dispatch/; $depth += :Dispatch::Config::CallerDepth; - @p{qw(P F L S)} = caller($depth); + @p{qw(P F L)} = caller($depth); + my $subname = (caller($depth+1))[3]; + $p{S} = $subname; + $subname =~ s/^.*:://; + $p{s} = $subname; } my $log = $format; $log =~ s{ (%d(?:{(.*?)})?)| # $1: datetime $2: datetime fmt - (?:%([%pmFLPniS])) # $3: others + (?:%([%pmFLPSnis])) # $3: others }{ if ($1 && $2) { _strftime($2); @@ -264,7 +268,8 @@ %n newline (\n) %% % itself %i process-id, returns POSIX::getpid() - %S subroutine + %S subroutine with package name + %s subroutine without package name Note that datetime (%d) format is configurable by passing C fmt in braket after %d. (I know it looks quite messy, but its