How do you use traceback ?

91 views
Skip to first unread message

wilk

unread,
Jun 22, 2023, 5:49:31 AM6/22/23
to golan...@googlegroups.com
There is a proposal to add a trace only opt-in at error level.
Only on this error I like to know the method and line.

*Apart* to know if it's something useful to add in the standard lib or
not (to don't pollute the github issue), how do you use the traceback in
errors ?

Do you add a full traceback like with pkg/errors ?
No traceback, decorate the error is enough ?
A mix like the proposal ?
Depends of the project ?

For me it depends of the project but after using pkg/errors a lot I
tried no traceback at all, it was working and it force me to think two
time how I decorate each error, that's eventually more accurate than a
traceback. And now in few places I see that my decorate looks like a
small traceback "I'm in method X and I call Y: %v"

Thought ?

--
wilk

Jason E. Aten

unread,
Jun 23, 2023, 7:37:43 AM6/23/23
to golang-nuts
I'm not sure what traceback refers to, but for me, debug logging with file:line number is essential, and I use
Reply all
Reply to author
Forward
0 new messages