App::CLI::Plugin::Log::Dispatch::Configurator::YAML - for App::CLI::Extension easy Log::Dispatch module
1.1
# MyApp.pm package MyApp; use strict; use base qw(App::CLI::Extension); # extension method __PACKAGE__->load_plugins(qw(Log::Dispatch::Configurator::YAML)); __PACKAGE__->config(log_dispatch_configurator_yaml => "/path/to/log.yml"); 1; # /path/to/log.yml dispatchers: - file - screen file: class: Log::Dispatch::File min_level: debug filename: /path/to/log mode: append newline: 1 close_after_write: 1 format: '[%d] [%p] %m' screen: class: Log::Dispatch::Screen min_level: debug stderr: 1 newline: 1 format: '%m' # MyApp/Hello.pm package MyApp::Hello; use strict; use feature ":5.10.0"; use base qw(App::CLI::Command); sub run { my($self, @args) = @_; $self->log->info("hello"); $self->log->error("fatal error"); $self->log->debug("debug"); } 1; # execute cat /path/to/log [Tue Apr 6 00:58:05 2010] [info] hello [Tue Apr 6 00:58:05 2010] [error] fatal error [Tue Apr 6 00:58:05 2010] [debug] debug
App::CLI::Plugin::Log::Dispatch::Configurator::YAML is App::CLI::Extension easy Log::Dispatch module
Akira Horimoto <kurt0027@gmail.com>
App::CLI::Extension Log::Dispatch::Configurator::YAML
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Copyright (C) 2010 Akira Horimoto
To install App::CLI::Plugin::Log::Dispatch::Configurator::YAML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::CLI::Plugin::Log::Dispatch::Configurator::YAML
CPAN shell
perl -MCPAN -e shell install App::CLI::Plugin::Log::Dispatch::Configurator::YAML
For more information on module installation, please visit the detailed CPAN module installation guide.