go-stack / stack

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

add %k and %+k to stack formatter #17

Closed chmorgan closed 7 years ago

chmorgan commented 7 years ago

Pull from golantern/stack, revert name changes back to go-stack/stack.

Tested here and reviewed implementation. Looks like a good approach as the call to .Name() does retrieve the package, filename and other information so it seems to make sense to overload the %n handler to also handle %k.

Goal is to have this available for go-kit/log to retrieve a package name.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 88.832% when pulling fe8b63a44f8473ce707d58d51941afcdbbfab0f8 on chmorgan:master into 54be5f394ed2c3e19dac9134a40a95ba5a017f7b on go-stack:master.

ChrisHines commented 7 years ago

Thanks for the PR. I haven't had time to do a full review yet, I'll try to get to that this weekend. In the meantime, could you please re-target this PR to the develop branch. That's where I stage changes prior to making a new release. Thanks.