On Wed, 11 Apr 2007, Ulf-D. Ehlert wrote:
> there's a bug in the Log-Log4perl documentaion:
> According to the Log::Log4perl man page, 'Log::Log4perl::MDC->get($key)'
> "... will return the string '[undef]'", if "no value has been
> stored previously under $key".
> The man page (and code) of "Log::Log4perl::MDC" says:
> "If no value exists to the given key, 'undef' is returned."
> It seems that "MDC->get()" can safely return "undef"; "%X{undefined}" will
> still print the *string* "[undef]".
Good catch, I've changed the text to read in the next release:
Index: Log4perl.pm
===================================================================
RCS file: /cvsroot/log4perl/Log-Log4perl/lib/Log/Log4perl.pm,v
retrieving revision 1.225
diff -r1.225 Log4perl.pm
2036,2037c2036
< will return the string C<"[undef]"> to allow for easy string interpolation
< later on.
---
> will return C<undef>.
2040,2041c2039,2042
< in C<Log::Log4perl::Layout::PatternLayout>.
< For example, an application taking a web request might store the remote host
---
> in C<Log::Log4perl::Layout::PatternLayout>. If the C<get()> method
> returns C<undef>, the placeholder will expand to the string C<[undef]>.
>
> An application taking a web request might store the remote host
Thanks for reporting this!
-- Mike
Mike Schilli
m...@pe...
>
> The same is true for "NDC-get()"...
>
> Regards,
> Ulf
> _______________________________________________________________
> SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
> kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> log4perl-devel mailing list
> log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>
|