summary refs log tree commit diff
path: root/lib/Net/HTTP/Spore/Role/Debug.pm
blob: 772373aa838d013f06daea1732a31f24c3cd1daa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package Net::HTTP::Spore::Role::Debug;

use Moose::Role;

has trace => (
    is      => 'rw',
    isa     => 'Bool',
    lazy    => 1,
    default => sub { $ENV{SPORE_TRACE} ? 1 : 0; }
);

sub _trace_msg { print STDOUT $_[1]."\n" if $_[0]->trace; }

1;