[SCM] libmessage-passing-perl Debian packaging branch, master, updated. debian/0.111-3-14-g44f6e88
Tomas Doran
bobtfish at bobtfish.net
Mon May 6 11:56:38 UTC 2013
The following commit has been merged in the master branch:
commit 14621fcf225a04454726b1a5107fc3e0bce87b41
Author: Tomas Doran <bobtfish at bobtfish.net>
Date: Sat Feb 25 12:42:36 2012 +0000
A null output, useful in some cases
diff --git a/lib/Log/Stash/Output/Null.pm b/lib/Log/Stash/Output/Null.pm
new file mode 100644
index 0000000..4ed12d2
--- /dev/null
+++ b/lib/Log/Stash/Output/Null.pm
@@ -0,0 +1,21 @@
+package Log::Stash::Output::Null;
+use Moose;
+use namespace::autoclean;
+
+with 'Log::Stash::Mixin::Output';
+
+sub consume {}
+
+__PACKAGE__->meta->make_immutable;
+1;
+
+=head1 NAME
+
+Log::Stash::Output::Null - /dev/null for logstash messages
+
+=head1 DESCRIPTION
+
+Throws away all messages passed to it.
+
+=cut
+
diff --git a/t/00_compile.t b/t/00_compile.t
index afdb2e9..5bf8c27 100644
--- a/t/00_compile.t
+++ b/t/00_compile.t
@@ -6,6 +6,8 @@ use Test::More;
use_ok('Log::Stash');
use_ok('Log::Stash::Output::STDOUT');
use_ok('Log::Stash::Input::STDIN');
+use_ok('Log::Stash::Output::Null');
+use_ok('Log::Stash::Output::Test');
done_testing;
diff --git a/t/output_null.t b/t/output_null.t
new file mode 100644
index 0000000..096a6c8
--- /dev/null
+++ b/t/output_null.t
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+use Test::More;
+use Try::Tiny;
+
+use Log::Stash::Output::Null;
+
+my $test = try { Log::Stash::Output::Null->new() }
+ catch { fail "Failed to construct $_" };
+ok $test;
+
+try { $test->consume('message') }
+ catch { fail "Failed to consume message: $_" };
+
+done_testing;
+
--
libmessage-passing-perl Debian packaging
More information about the Pkg-perl-cvs-commits
mailing list