From: Henry Van Styn Date: Tue, 13 May 2014 16:00:41 +0000 (-0400) Subject: Turns off logger 'autoflush' - required by new Catalyst API X-Git-Tag: v0.32~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=659bc603b5498eae0bf93e3f27b25e71331961fc;p=catagits%2FCatalyst-Plugin-Static-Simple.git Turns off logger 'autoflush' - required by new Catalyst API --- diff --git a/lib/Catalyst/Plugin/Static/Simple.pm b/lib/Catalyst/Plugin/Static/Simple.pm old mode 100644 new mode 100755 index 39a8f77..574a794 --- a/lib/Catalyst/Plugin/Static/Simple.pm +++ b/lib/Catalyst/Plugin/Static/Simple.pm @@ -14,6 +14,15 @@ our $VERSION = '0.31'; has _static_file => ( is => 'rw' ); has _static_debug_message => ( is => 'rw', isa => ArrayRef[Str] ); +after setup_finalize => sub { + my $c = shift; + + # New: Turn off new 'autoflush' flag in logger (see Catalyst::Log). + # This is needed to surpress output of debug log messages for + # static requests: + $c->log->autoflush(0) if $c->log->can('autoflush'); +}; + before prepare_action => sub { my $c = shift; my $path = $c->req->path;