zerolog icon indicating copy to clipboard operation
zerolog copied to clipboard

Added multistack logging

Open mec07 opened this issue 5 years ago • 4 comments

There is an issue with the way the MarshalStack is implemented right now. It only prints info on the last stack trace -- which is really unhelpful if you have multiple stacks (i.e. you really want to know where the original stack trace came from).

This pull request adds the ability to log all of the stack traces collected by the errors. It is pretty much there, but I've marked as wip because the exact formatting needs to be determined -- probably better to use an inbuilt encoding mechanism of zerolog (instead of json), but I'm not too familiar with the encoding of zerolog... @rs do you have any suggestions? Thanks!

mec07 avatar Mar 21 '19 18:03 mec07

Actually I was being really dumb, I've worked out how to do the encoding properly now (i.e. without json.Marshal).

mec07 avatar Mar 21 '19 19:03 mec07

@rs I would love to hear your thoughts on this. I am using MarshalMultiStack from my own fork for now and it has fixed the problem of the incomplete stacktrace from MarshalStack.

mec07 avatar Mar 22 '19 16:03 mec07

@rs have you had a chance to look at this? Thanks! :)

mec07 avatar Mar 29 '19 16:03 mec07

@rs I'd love to hear your thoughts on this.

mec07 avatar Apr 08 '19 12:04 mec07