summaryrefslogtreecommitdiffstats
path: root/t/lib/Log/Dispatch/ToString.pm
diff options
context:
space:
mode:
Diffstat (limited to 't/lib/Log/Dispatch/ToString.pm')
-rw-r--r--t/lib/Log/Dispatch/ToString.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/lib/Log/Dispatch/ToString.pm b/t/lib/Log/Dispatch/ToString.pm
new file mode 100644
index 0000000..9819c29
--- /dev/null
+++ b/t/lib/Log/Dispatch/ToString.pm
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+package Log::Dispatch::ToString;
+use base 'Log::Dispatch::Output';
+
+sub new {
+ my $class = shift;
+ my $self = bless {}, $class;
+ $self->_basic_init(@_);
+ $self->{_string} = '';
+ return $self;
+}
+
+sub log_message {
+ my $self = shift;
+ my %args = @_;
+ $self->{_string} .= $args{message};
+}
+
+sub get_string {
+ my $self = shift;
+ return $self->{_string};
+}
+
+1;