Log::Any::Adapter::Mojo
use Mojo::Log; use Log::Any::Adapter; Log::Any::Adapter->set('Mojo', logger => Mojo::Log->new);
Mojolicious app:
use Mojo::Base 'Mojolicious'; use Log::Any::Adapter; sub startup { my $self = shift; Log::Any::Adapter->set('Mojo', logger => $self->app->log); }
Mojolicious::Lite app:
use Mojolicious::Lite; use Log::Any::Adapter; Log::Any::Adapter->set('Mojo', 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, Log::Any::Adapter, Mojo::Log
Henry Tang
Copyright (C) 2011 Henry Tang
Log::Any::Adapter::Mojo 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::Mojo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Any::Adapter::Mojo
CPAN shell
perl -MCPAN -e shell install Log::Any::Adapter::Mojo
For more information on module installation, please visit the detailed CPAN module installation guide.