File: basic.t

package info (click to toggle)
liblog-dispatch-message-passing-perl 0.009-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 268 kB
  • sloc: perl: 1,406; makefile: 8; sh: 4
file content (26 lines) | stat: -rw-r--r-- 517 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use warnings;

use Test::More;

use Log::Dispatch;
use Log::Dispatch::Message::Passing;
use Message::Passing::Output::Test;

my $log = Log::Dispatch->new;

my $test = Message::Passing::Output::Test->new;

$log->add(Log::Dispatch::Message::Passing->new(
    name      => 'myapp_logstash',
    min_level => 'debug',
    output     => $test,
));

$log->warn("foo");

is $test->message_count, 1;
is_deeply [$test->messages], [{level => 'warning', name => 'myapp_logstash', message => 'foo'}];

done_testing;