houseabsolute / Log-Dispatch

Dispatches messages to one or more outputs
https://metacpan.org/release/Log-Dispatch/
Other
12 stars 29 forks source link

Avoid warning about closing unopened filehandle during destruction #2

Closed thaljef closed 11 years ago

thaljef commented 11 years ago

If the filehandle isn't open, then closing it throws a warning. This could happen if the application blows up before the logging ever starts. So to avoid the warning, we check if the filehandle is open before trying to close. Scalar::Util::openhandle seems to be best way to do this. Using tell() throws the same warning, and fileno() doesn't always give the right answer.

thaljef commented 11 years ago

Any chance of getting this pulled in the next week?

autarch commented 11 years ago

Apparently I merged this a long time ago but never closed the pull req.