Skip to content

Commit

Permalink
Merge pull request #4 from brad-mac/master
Browse files Browse the repository at this point in the history
Fix for RT#98034 where Mojolicious calls format()
  • Loading branch information
garu committed May 30, 2016
2 parents ff217e5 + fe568a9 commit 1a0e19d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: perl
perl:
- "5.22"
- "5.20"
- "5.18"
- "5.16"
- "5.14"
11 changes: 9 additions & 2 deletions lib/MojoX/Log/Log4perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ has max_history_size => 10;

# development notes: Mojo::Log provides 'path' 'handle' and 'format'
# to handle log location and formatting. Those make no sense in a Log4perl
# environment (where you can set appenders as you wish) so they are
# not implemented here.
# environment (where you can set appenders as you wish) so 'path and 'handle'
# not implemented here; 'format' simply returns the passed-in strings joined by
# newlines as otherwise Mojo::Log complains (RT #98034).

sub format {
# warn 'format() is not properly implemented in MojoX::Log::Log4perl. Please use appenders.';
# return sub { '[' . localtime(shift) . '] [' . shift() . '] ' . join("\n", @_, '') };
return sub { join("\n", @_, '') };
}

sub new {
my ($class, $conf_file, $watch) = (@_);
Expand Down

0 comments on commit 1a0e19d

Please sign in to comment.