Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: lightweight stack info (data > text)

by tye (Sage)
on Jun 12, 2014 at 04:53 UTC ( [id://1089649]=note: print w/replies, xml ) Need Help??


in reply to lightweight stack info

Personally, I'd just grab the file names, line numbers, and function names for the bottom 10 stack frames and do zero formatting. Just stuff those into a simple array. You can format those later only if the information needs to be shown.

You can likely format the information better than Carp does because you know your specifics. For example, I don't want full paths for every single source file at work because most of them are going to start with /site/ourcorp/myproduct/version/lib/FOO, a long value whose repetition just makes it harder to read the useful information.

I also don't want to see the attempts at abbreviating which arguments got passed to each function. If I really need that level of detail, then I'm going to build my own way of declaring "this is what is interesting about this particular call to this function" rather than hoping that an extremely terse summary of the top-level structure of each argument is even moderately informative.

I would hope that such would be less of a performance impact than what Carp does. But I have not measured the difference. It might still be too slow for your case.

- tye        

Replies are listed 'Best First'.
Re^2: lightweight stack info (data > text)
by hv (Prior) on Jun 12, 2014 at 08:31 UTC

    Thanks, that's probably what I'll end up doing - after a good long think about what I'm capturing that's going to end up changing under my feet, or hanging onto a ref past its due dying date.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1089649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found