Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use Mojo::File in Mojo::Log
  • Loading branch information
kraih committed Feb 5, 2017
1 parent 3135677 commit 10c0118
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/Log.pm
Expand Up @@ -3,6 +3,7 @@ use Mojo::Base 'Mojo::EventEmitter';

use Carp 'croak';
use Fcntl ':flock';
use Mojo::File;
use Mojo::Util 'encode';

has format => sub { \&_format };
Expand All @@ -12,8 +13,7 @@ has handle => sub {
return \*STDERR unless my $path = shift->path;

# File
croak qq{Can't open log file "$path": $!} unless open my $file, '>>', $path;
return $file;
return Mojo::File->new($path)->open('>>');
};
has history => sub { [] };
has level => 'debug';
Expand Down

0 comments on commit 10c0118

Please sign in to comment.