Log-Contextual

 view release on metacpan or  search on metacpan

t/simplelogger.t  view on Meta::CPAN

  },
  'fatal does not get called'
);

{
  my $tempfile = File::Temp->new(UNLINK => 1, TEMPLATE => 'stderrXXXXXX');
  my $fn = fileno($tempfile);
  open(STDERR, ">&$fn") or die $!;
  log_debug { 'frew' };

  my $out = do { local @ARGV = $tempfile; <> };
  is($out, "[debug] frew\n", 'SimpleLogger outputs to STDERR correctly');
}

my $response;
my $l2 = Log::Contextual::SimpleLogger->new({
  levels  => [qw{trace debug info warn error fatal}],
  coderef => sub { $response = $_[0] },
});
{
  local $SIG{__WARN__} = sub { };    # do this just to hide warning for tests

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.648 second using v1.00-cache-2.02-grep-82fe00e-cpan-c9a218a2bbc )