-
Notifications
You must be signed in to change notification settings - Fork 40
Description
Incredible project! Such a beautiful night and day difference.
Currently, we can control the amount of lines before and after the trace line in methods such as:
tracerr.SprintSourceColor(beforeLines, afterLines)
Is would be incredibly helpful if we could also specify the amount of stack frames printed. For example:
tracerr.SprintSourceColor(beforeLines, afterLines, stackFrameLimit)
Or some similar signature, getting everything every trace down to the runtime assembly is rather cool but in the majority of cases you only want the last 3-4 stack frames in any given trace for debugging. This will reduce output in terminal and show only the level of granularity we need.
Another potential attack vector which would potentially help performance:
Stack trace causes a performance overhead, depending on a stack trace depth
This could potentially be mitigated if an environmental variable such as STACK_FRAME_LIMIT
was added to control the max stack length big-endian style. Only the last n stack frames would be tracked, and as a frame is added, the earliest frame is popped off. This would reduce the stack trace depth and potentially decrease performance overhead on deep traces.