Yes, it's possible to wrap all calls to the logger with try{} blocks (ala
Try::Tiny) or eval{}. I have a separate large codebase that resorted to
exactly that. It's not what I would call graceful or pretty, especially
since it changes the caller depth, so the use of Log4perl to log the
calling method needed adjusting.
Much more favorable is to catch the error 'at the source', inside LDLSF.
The current behavior brings the entire program to a halt, unless one has
remembered to try{} the logging... which isn't common practice.
An option such as 'ignore_errors' would be an acceptable solution.
Adam, if you're willing to have Slaven or myself become the maintainer,
that's great. Just let us know.
thanks,
--Chan
On Fri, Sep 11, 2015 at 3:23 AM Adam Thomason via RT <
bug-Log-Dispatch-Log-Syslog-Fast@rt.cpan.org> wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=107021 >
>
> To be honest I had forgotten I wrote this package, and you're the first
> person ever to contact me about it :). So consider the following comments
> to be from the place of a now very removed user.
>
> On Fri Sep 11 02:14:35 2015, SREZIC wrote:
> > So are you suggesting that the client protects every $log->... call in
> > an eval or try/catch block?
>
> Certainly not with explicit code at every callsite, but my usage of this
> library was wrapped in a logging middleware that eval{}'ed every call and
> simply logged errors to a separate stream and carried on, so it wasn't an
> actual problem. Yours and other clients should probably do the same, but...
>
> > Maybe it would be better if there was an
> > option in the constructor to allow the user to ignore errors, say:
> > ignore_errors => $bool.
>
> Yours is the only concerned vote, so sure. I'm happy to make you a
> maintainer, let me know if you'd like to take it over.
>