Skip to content

Commit

Permalink
Allow log level override using OPAN_LOG_LEVEL
Browse files Browse the repository at this point in the history
  • Loading branch information
sjn committed Sep 4, 2023
1 parent 3b4a436 commit 09ea5bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion script/opan
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ get '/autopin/authors/id/*dist_path' => sub {
return $_[0]->render(text => 'Not found', status => 404);
};

caller() ? app : app->tap(sub { shift->log->level('fatal') })->start;
caller() ? app : app->tap(sub { shift->log->level($ENV{OPAN_LOG_LEVEL} || 'fatal') })->start;

=head1 NAME
Expand Down Expand Up @@ -665,6 +665,11 @@ www.cpan.org. Remember that if you need to temporarily overlay your overlay
but only for one user, there's nothing stopping you setting OPAN_MIRROR to
another opan.
=head2 logging
The default log level is C<fatal>. Set the ENV var OPAN_LOG_LEVEL to one of
the log levels accepted by L<Mojo::Log>, like C<warn>, C<info> or C<debug>.
=head1 AUTHOR
Matt S. Trout (mst) <[email protected]>
Expand Down

0 comments on commit 09ea5bf

Please sign in to comment.