Skip to content

Conversation

@bokutin
Copy link

@bokutin bokutin commented Apr 18, 2018

Since there is a request #20, it may be good to be able to controll.

  • Log::Dispatch::Syslog->new( log_message_exception => none|warn|ignore )
  • use warnings::register and warnings::enabled()

{
my $dispatch = Log::Dispatch->new;
$dispatch->add(
Log::Dispatch::Syslog->new(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a dangerously live test. It's much better to override the subs in the Sys::Syslog namespace to mock things out. See the syslog.t test for an example.

)
);

my $warn = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the Test::Warnings CPAN module. It makes this much simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants