Skip to content

Commit

Permalink
more consistent log messages for missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 26, 2015
1 parent d5bbb14 commit 32695ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -160,7 +160,7 @@ sub _render {
sub _static {
my ($c, $file) = @_;
return !!$c->rendered if $c->app->static->serve($c, $file);
$c->app->log->debug(qq{File "$file" not found, public directory missing?});
$c->app->log->debug(qq{Static file "$file" not found});
return !$c->helpers->reply->not_found;
}

Expand Down
3 changes: 1 addition & 2 deletions t/mojolicious/lite_app.t
Expand Up @@ -767,8 +767,7 @@ $log = '';
$cb = $t->app->log->on(message => sub { $log .= pop });
$t->get_ok('/source?fail=1')->status_is(404)->header_is('X-Missing' => 1)
->content_is("Oops!\n");
like $log, qr/File "does_not_exist.txt" not found, public directory missing\?/,
'right message';
like $log, qr/Static file "does_not_exist.txt" not found/, 'right message';
$t->app->log->unsubscribe(message => $cb);

# With body and max message size
Expand Down

0 comments on commit 32695ac

Please sign in to comment.