Log::Any::Adapter::MojoLog - Log::Any integration for Mojo::Log
use Mojo::Log; use Log::Any::Adapter; Log::Any::Adapter->set('MojoLog', logger => Mojo::Log->new);
Mojolicious app:
use Mojo::Base 'Mojolicious'; use Log::Any::Adapter; sub startup { my $self = shift; Log::Any::Adapter->set('MojoLog', logger => $self->app->log); }
Mojolicious::Lite app:
use Mojolicious::Lite; use Log::Any::Adapter; Log::Any::Adapter->set('MojoLog', logger => app->log);
This Log::Any adapter uses Mojo::Log for logging. Mojo::Log must be initialized before calling set. The parameter logger must be used to pass in the logging object.
Log levels are translated from Log::Any to Mojo::Log as follows:
trace -> debug notice -> info warning -> warn critical -> fatal alert -> fatal emergency -> fatal
Log::Any::Adapter::Mojo - The original release of this codebase
Log::Any
Log::Any::Adapter
Mojo::Log
http://github.com/jberger/Log-Any-Adapter-MojoLog
Joel Berger, <joel.a.berger@gmail.com>
Dan Book (Grinnz)
This module was forked from Log::Any::Adapter::Mojo which bears the copyright
Copyright (C) 2011 Henry Tang
and is licensed under the Artistic License version 2.0
This fork began as fixes for RT#111631 and RT#101167. However the eventual changes that were made prevented any possibility for keeping a consistent log formatter. As such I think it is the responsible action to fork the module to release it. I intend to work with the original author to see how much of these changes can be backported into that codebase without breaking the format.
Log::Any::Adapter::MojoLog is Copyright (C) 2016 "AUTHOR" and "CONTRIBUTORS".
Log::Any::Adapter::MojoLog is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
To install Log::Any::Adapter::MojoLog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Any::Adapter::MojoLog
CPAN shell
perl -MCPAN -e shell install Log::Any::Adapter::MojoLog
For more information on module installation, please visit the detailed CPAN module installation guide.