Subject: | [PATCH] Make printf-style methods produce truly single-line strings |
Date: | Wed, 21 Aug 2013 11:48:03 +0200 |
To: | bug-Log-Any [...] rt.cpan.org |
From: | Maxim Vuets <maxim.vuets [...] booking.com> |
Distribution: Log-Any-0.15
Per Log::Any POD the printf-style methods have an advantage that: "Any complex
references (like C<\@params> above) are automatically converted to single-line
strings with C<Data::Dumper>". I find this feature really cool! But sadly it
does not always work properly, namely when a given structure contains a
multi-line string. For example:
Log-Any-0.15$ perl -Ilib -MLog::Any='$log' -MLog::Any::Adapter=Stderr -e '$log->infof("%s", \"hey\nthere")'
\'hey
there'
Gladly it can be easily fixed by setting a Data::Dumper parameter Useqq to 1.
Then the output becomes this:
Log-Any-0.15-patched$ perl -Ilib -MLog::Any='$log' -MLog::Any::Adapter=Stderr -e '$log->infof("%s", \"hey\nthere")'
\"hey\nthere"
Please find the patch enclosed.
Message body is not shown because sender requested not to inline it.