[Rt-commit] r18225 - in rt/3.999/branches/merge_to_3.8.2: . lib/RT/Test/Warnings
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Feb 5 01:05:30 EST 2009
Author: sunnavy
Date: Thu Feb 5 01:05:24 2009
New Revision: 18225
Added:
rt/3.999/branches/merge_to_3.8.2/lib/RT/Test/Warnings/
rt/3.999/branches/merge_to_3.8.2/lib/RT/Test/Warnings.pm
rt/3.999/branches/merge_to_3.8.2/lib/RT/Test/Warnings/Appender.pm
Modified:
rt/3.999/branches/merge_to_3.8.2/ (props changed)
Log:
r19593 at sunnavys-mb: sunnavy | 2009-02-05 13:54:55 +0800
added RT::Test::Warnings stuff
Added: rt/3.999/branches/merge_to_3.8.2/lib/RT/Test/Warnings.pm
==============================================================================
--- (empty file)
+++ rt/3.999/branches/merge_to_3.8.2/lib/RT/Test/Warnings.pm Thu Feb 5 01:05:24 2009
@@ -0,0 +1,14 @@
+package RT::Test::Warnings;
+use strict;
+use warnings;
+
+use RT::Test::Warnings::Appender;
+use Log::Log4perl;
+
+sub import {
+ my $root = Log::Log4perl->get_logger('');
+ my $a = RT::Test::Warnings::Appender->new( name => "WarningAppender" );
+ $root->add_appender($a);
+}
+
+1;
Added: rt/3.999/branches/merge_to_3.8.2/lib/RT/Test/Warnings/Appender.pm
==============================================================================
--- (empty file)
+++ rt/3.999/branches/merge_to_3.8.2/lib/RT/Test/Warnings/Appender.pm Thu Feb 5 01:05:24 2009
@@ -0,0 +1,18 @@
+package RT::Test::Warnings::Appender;
+use strict;
+use warnings;
+use base qw/Log::Log4perl::Appender/;
+
+sub new {
+ my $class = shift;
+ return bless {@_}, $class;
+}
+
+sub log {
+ my $self = shift;
+ my $message = $_[0]{message};
+ my @messages = ref $message eq "ARRAY" ? @{$message} : ($message);
+ warn @messages;
+}
+
+1;
More information about the Rt-commit
mailing list