go-stack / stack

Package stack implements utilities to capture, manipulate, and format call stacks.
MIT License
395 stars 33 forks source link

add TraceFrom(pcs) for "on-demand" StackTrace instantiation #24

Closed lukseven closed 3 years ago

lukseven commented 3 years ago

Allows to record just the pcs from runtime.Callers when an error occurs and convert them to a StackTrace only if the trace is actually needed, e.g. when printing to a log.

Improves performance about 4x.