summaryrefslogtreecommitdiff
path: root/lib/GitHub/Collector/Role/Logger.pm
blob: 0d1630792845eceb5cbfc90d2a3880323adcbc8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package GitHub::Collector::Role::Logger;

use Moose::Role;
use Log::Dispatchouli;

has logger => (
    is      => 'rw',
    isa     => 'Log::Dispatchouli',
    lazy    => 1,
    default => sub {
        my $logger = Log::Dispatchouli->new(
            {
                ident     => 'GitHub::Collector',
                facility  => 'user',
                to_stdout => 1,
            }
        );
    },
    handles => {
        log   => 'log',
        debug => 'log_debug',
        fatal => 'log_fatal',
        error => 'log_error',
    },
);

1;