super basic test logger for showing off
Arthur Axel 'fREW' Schmidt [Tue, 16 Feb 2010 05:28:20 +0000 (23:28 -0600)]
t/lib/WarnLogger.pm [new file with mode: 0644]
t/play.t [new file with mode: 0644]

diff --git a/t/lib/WarnLogger.pm b/t/lib/WarnLogger.pm
new file mode 100644 (file)
index 0000000..b64f540
--- /dev/null
@@ -0,0 +1,12 @@
+package WarnLogger;
+
+use POSIX qw(strftime);
+sub new { bless {}, __PACKAGE__ }
+sub debug {
+   my @caller = caller(1);
+   my $time = strftime "%y-%m-%d %H:%M:%S", localtime;
+   warn "[$time][$caller[0]][$caller[1]][$caller[2]][$_[1]]\n"
+}
+sub is_debug { 1 }
+
+1;
diff --git a/t/play.t b/t/play.t
new file mode 100644 (file)
index 0000000..d1add5e
--- /dev/null
+++ b/t/play.t
@@ -0,0 +1,17 @@
+use strict;
+use warnings;
+
+use lib 't/lib';
+use WarnLogger;
+use Log::Contextual;
+use Test::More qw(no_plan);
+
+my $logger =  WarnLogger->new;
+
+set_logger { $logger };
+log_debug { 'set_logger' };
+log_debug { 'simple log 1' };
+log_debug { 'simple log 2' };
+sleep 1;
+log_debug { 'simple log 3' };
+