What you really need is an approach to restrict your logging to uncaught fatal errors only. (the cost of serialization does not matter than!)
I would maybe try to patch the module in question, such that eval { BLOCK } is replaced by something disabling the die-handler.
(and if you are lucky this module already uses something like Try::Tiny and you can restrict your patch there :)
prove of concept:
$SIG{__DIE__}= sub {warn "\$SIG{__DIE__} handles: $_[0]"; }; sub my_eval (&) { eval { local $SIG{__DIE__}; #deactivate die-handler $_[0]->(); } } warn "--- normal eval\n"; eval { die "EVAL\n" } or warn "Eval caught: $@\n"; warn "--- improved eval\n"; my_eval { die "MY_EVAL\n" } or warn "My_Eval caught: $@\n"; warn "--- top level die\n"; die "OUTER SCOPE\n";
OUTPUT:
--- normal eval $SIG{__DIE__} handles: EVAL Eval caught: EVAL --- improved eval My_Eval caught: MY_EVAL --- top level die $SIG{__DIE__} handles: OUTER SCOPE OUTER SCOPE Compilation exited abnormally with code 255 at Thu Jun 12 03:33:59
It's hard to believe that you are the first having this problem, curious to here about other solutions now that the question is clearer.
Cheers Rolf
(addicted to the Perl Programming Language)
In reply to Re: lightweight stack info # wrong question?
by LanX
in thread lightweight stack info
by hv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |