Mojo::Log::More - Mojo::Log with More details
use Mojo::Log::More; # Constructor is identical to Mojo::Log my $log = Mojo::Log::More->new; # Replace the default log in a Mojolicious::Lite application app->log($log); # Output: 2015-02-20T23:30:53 filename.pl:13 INFO> something happened... app->log->info("something happened..."); # Create a wrapper function sub debug { local Mojo::Log::More::caller_depth += 1; $log->debug(@_); }
This module is a small wrapper around Mojo::Log which allows you to log caller() information with your log messages automatically. You do not need to use big logging systems like Log::Dispatch or Log::Log4perl to get this feature anymore.
caller()
format
The format method receives the same arguments as in Mojo::Log, but with one more argument at the end: an arrayref containing the result of caller(). You must pop it before accessing the log messages.
pop
This modules includes its own format method wich uses the caller arguments, in particular the source filename and line number. It also prints the date in a more compact format (ISO 8601).
caller
Please report any bugs or feature requests at https://github.com/oliwer/mojo-log-more/issues
You can find documentation for this module with the perldoc command.
perldoc Mojo::Log::More
You can also look for information at:
RT: CPAN's request tracker (please use Github instead)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Mojo-Log-More
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Mojo-Log-More
CPAN Ratings
http://cpanratings.perl.org/d/Mojo-Log-More
Search CPAN
http://search.cpan.org/dist/Mojo-Log-More/
Olivier Duclos, <odc at cpan.org>
<odc at cpan.org>
Copyright 2015 Olivier Duclos.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Mojolicious
To install Mojo::Log::More, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::Log::More
CPAN shell
perl -MCPAN -e shell install Mojo::Log::More
For more information on module installation, please visit the detailed CPAN module installation guide.