File: default-adapter-use.t

package info (click to toggle)
liblog-any-perl 1.717-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 448 kB
  • sloc: perl: 1,499; makefile: 11
file content (18 lines) | stat: -rw-r--r-- 443 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;
use Test::More tests => 3;

use Log::Any '$log', default_adapter => 'Stderr';

isa_ok( $log, 'Log::Any::Proxy', 'we have a proxy...' );
ok( !$log->isa('Log::Any::Proxy::Null'), '...but it\'s not the null proxy' );

my $err;
{
    open my $fd, ">", \$err;
    local *STDERR = $fd;
    $log->err( "Foobared. This test is likely broken if you see this message" );
};

like $err, qr/Foobared/, "Log captured on STDERR";