1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package presque::worker::Role::Logger; use Moose::Role; use Log::Dispatch; use Log::Dispatch::Screen; has logger => ( is => 'rw', isa => 'Object', lazy => 1, default => sub { my $self = shift; my $log = Log::Dispatch->new(); $log->add( Log::Dispatch::Screen->new( name => 'screen', min_level => 'debug', newline => 1, ) ); } ); 1;