Skip to content

Commit 09ea5bf

Browse files
author
Salve J. Nilsen
committed
Allow log level override using OPAN_LOG_LEVEL
1 parent 3b4a436 commit 09ea5bf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

script/opan

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ get '/autopin/authors/id/*dist_path' => sub {
394394
return $_[0]->render(text => 'Not found', status => 404);
395395
};
396396

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

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

0 commit comments

Comments
 (0)