Skip to content

Commit

Permalink
Only use log directory if it is in fact a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jberger committed Nov 8, 2014
1 parent b4a2919 commit 7c2c2ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -171,7 +171,7 @@ sub new {
# Check if we have a log directory
my $mode = $self->mode;
$self->log->path($home->rel_file("log/$mode.log"))
if -w $home->rel_file('log');
if -d $home->rel_dir('log') and -w _;

$self->plugin($_)
for qw(HeaderCondition DefaultHelpers TagHelpers EPLRenderer EPRenderer);
Expand Down
2 changes: 2 additions & 0 deletions t/mojolicious/lite_app.t
Expand Up @@ -20,6 +20,8 @@ is $@, qq{Plugin "does_not_exist" missing, maybe you need to install it?\n},
# Default
app->defaults(default => 23);

is app->log->handle, \*STDERR, 'log handle is correct';

# Secret
my $log = '';
my $cb = app->log->on(message => sub { $log .= pop });
Expand Down
Empty file added t/mojolicious/log
Empty file.

0 comments on commit 7c2c2ee

Please sign in to comment.