Turns off logger 'autoflush' - required by new Catalyst API
Henry Van Styn [Tue, 13 May 2014 16:00:41 +0000 (12:00 -0400)]
lib/Catalyst/Plugin/Static/Simple.pm [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 39a8f77..574a794
@@ -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;