Plack::Middleware::NullLogger - Send logs to /dev/null


Plack documentation Contained in the Plack distribution.

Index


Code Index:

NAME

Top

Plack::Middleware::NullLogger - Send logs to /dev/null

SYNOPSIS

Top

  enable "NullLogger";

DESCRIPTION

Top

NullLogger is a middleware component that receives logs and does nothing but discarding them. Might be useful to shut up all the logs from frameworks in one shot.

AUTHOR

Top

Tatsuhiko Miyagawa


Plack documentation Contained in the Plack distribution.

package Plack::Middleware::NullLogger;
use strict;
use parent qw/Plack::Middleware/;

sub call {
    my($self, $env) = @_;
    $env->{'psgix.logger'} = sub { };
    $self->app->($env);
}

1;

__END__