Skip Menu |

This queue is for tickets about the Plack-Middleware-Debug-Log4perl CPAN distribution.

Report information
The Basics
Id: 106655
Status: new
Priority: 0/
Queue: Plack-Middleware-Debug-Log4perl

People
Owner: Nobody in particular
Requestors: kes-kes [...] yandex.ru
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.04
Fixed in: (no value)



Subject: Multiline log messages are displayed incorrectly
The example of displaying multiple line messages on debug panel in the attached file
Subject: debug-panel-bug4.png
debug-panel-bug4.png
From: kes-kes [...] yandex.ru
Here I just did: my $app = sub { my $env = shift; { package HTML::Mason::Commands; use Log::Log4perl; use Data::Dump qw/ pp /; my $logger = Log::Log4perl::get_logger(); $logger->warn( 'Hi', pp $env ); } };
From: kes-kes [...] yandex.ru
diff --git a/Log4perl.pm.orig b/Log4perl.pm index f9e54dd..7102435 100644 --- a/Log4perl.pm.orig +++ b/Log4perl.pm @@ -33,7 +33,7 @@ sub run my $logger = Log::Log4perl->get_logger(""); # Define a layout - my $layout = Log::Log4perl::Layout::PatternLayout->new("%r >> %p >> %m >> %c >> at %F line %L%n"); + my $layout = Log::Log4perl::Layout::PatternLayout->new("%r >> %p >> %m{indent=1} >> %c >> at %F line %L%n"); # Define an 'in memory' appender my $appender = Log::Log4perl::Appender->new( @@ -57,10 +57,9 @@ sub run my $log = $appender->{appender}->{buffer}; - $log =~ s/ >> /\n/g; - my $list = [ split '\n', $log ]; + my @list = map { split ' >> ' } split /\n\S/, $log; - $panel->content( sub { $self->render_list_pairs($list) } ); + $panel->content( sub { $self->render_list_pairs( \@list ) } ); } else { @@ -87,7 +86,7 @@ my $list_template = __PACKAGE__->build_template(<<'EOTMPL'); <tr class="<%= ++$i % 2 ? 'plDebugOdd' : 'plDebugEven' %>"> <td><%= $time %></td> <td><%= $level %></td> - <td><%= $message %></td> + <td><pre><%= $message %></pre></td> <td><%= $source %></td> <td><%= $line %></td> </tr> Also do not forget to update PatternLayout in the DOC
From: kes-kes [...] yandex.ru
145c142 < log4perl.appender.DebugPanel.layout.ConversionPattern = %r >> %p >> %m >> %c >> at %F line %L%n --- Show quoted text
> log4perl.appender.DebugPanel.layout.ConversionPattern = %r >> %p >> %m{indent=1} >> %c >> at %F line %L%n