Skip to content

Commit

Permalink
Allow log level override
Browse files Browse the repository at this point in the history
- Log level can be set using MOJO_LOG_LEVEL
- Add git repo metadata to Makefile.PL
  • Loading branch information
sjn committed Nov 14, 2023
1 parent 0267690 commit 600ec67
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@ WriteMakefile(
'File::chdir' => '0.1010',
'Capture::Tiny' => '0.27',
},
META_MERGE => {
"meta-spec" => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'https://github.com/shadowcat-mst/App-opan.git',
web => 'https://github.com/shadowcat-mst/App-opan',
},
},
},
);
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 600ec67

Please sign in to comment.