summaryrefslogtreecommitdiff
path: root/lib/Net/HTTP/Spore/Role/Debug.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Net/HTTP/Spore/Role/Debug.pm')
-rw-r--r--lib/Net/HTTP/Spore/Role/Debug.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Spore/Role/Debug.pm b/lib/Net/HTTP/Spore/Role/Debug.pm
new file mode 100644
index 0000000..772373a
--- /dev/null
+++ b/lib/Net/HTTP/Spore/Role/Debug.pm
@@ -0,0 +1,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;