Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Turn off warnings, diagnostics?

by davido (Archbishop)
on Nov 07, 2012 at 17:52 UTC ( #1002701=note: print w/replies, xml ) Need Help??

in reply to Turn off warnings, diagnostics?

I want the warnings. I just want to make sure they're directed somewhere useful, such as a log file.

In my opinion, tests should exercise the code to the degree that your own carp, croak, cluck, confess, die, and warn statements are executed. Tests should also check that there aren't any Perl-generated warnings and un-caught exceptions (deaths). In a real world the tests you write probably won't anticipate every possible way that a script might generate a warning. Those warnings (and even fatals) it does generate should be logged so that the maintainer can investigate and take corrective action.

Silencing all warnings so that they bother nobody might prevent the maintainer from even knowing there's an issue, and possibly a serious issue, that happens to only turn up out in the real world (ie, production). When I ship code I intend to also be the one maintaining it, and I want to have the ability to quickly ascertain there are no problems that I didn't anticipate. I wouldn't be as effective if I took the "bury my head in the sand" approach.

Diagnostics, on the other hand, have no place in production code. The warning itself is plenty, because in the event I am unfamiliar with a given warning I can always just dive into perldiag to read what it means.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002701]
[Corion]: Greetings from the German Perl Workshop ;)
[1nickt]: Isn't it YAPC::NA too?
[Corion]: Yes, but I think there's not that much overlap in our audiences ;))
[1nickt]: Sheesh, I would have thought they would be satellite-linked somehow!
[1nickt]: Who's writing all the code this week, then?

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-06-27 20:56 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (613 votes). Check out past polls.