[interchange] Correct [log type=error|debug] final newline behavior
Jon Jensen <[email protected]>
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit d0b179e3eb62763fc442093bf5892123615a435e Author: Jon Jensen <[email protected]> Date: Thu Apr 3 18:28:05 2014 -0600 Correct [log type=error|debug] final newline behavior It shouldn't quote the final newline with > since ::logError doesn't. (And because it makes a mess of the log.) lib/Vend/Interpolate.pm | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) --- diff --git a/lib/Vend/Interpolate.pm b/lib/Vend/Interpolate.pm index b44f185..ec230e1 100644 --- a/lib/Vend/Interpolate.pm +++ b/lib/Vend/Interpolate.pm @@ -2016,8 +2016,9 @@ sub log { } elsif($opt->{type} =~ /^(?:error|debug)/) { if ($opt->{file}) { + $data =~ s/\n\z//; $data = format_log_msg($data) unless $data =~ s/^\\//;; - $status = Vend::Util::writefile($file, $data, $opt); + $status = Vend::Util::writefile($file, $data . "\n", $opt); } elsif ($opt->{type} =~ /^debug/) { $status = Vend::Util::logDebug($data);