-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to print the pkg/errors #895
Comments
The problem lies within pkg/errors package, because Their The only way to print the stack coming inside a pkg/errors error is by explicitly formatting it with
The only way I can think of bypassing the stack problem is creating your own error wrapper. |
Thank you. I appreciate the official response. |
But it is, and the procedure is well documented. |
You are purposely being obtuse. Ever other logging framework in every other language prints the full stack of an error when it gets on. Look at Slf4j. What I wanted is to get the full stack by only passing the error to WithError. Such a process does not exist. If you did research you’d find a PR that people want for this tool, but are blocked by the interface. Please stop inserting yourself into topics you have no desire to fully appreciate. |
@virmundi Are you replying to me? That's a very odd response to a comment in support of your issue, and offering a solution. |
@flimzy please stop harassing me across the internet. As I’ve explained to you here and on SO, the question is how to use Logrus as one would use Slf4j, Apache common logging, or any other Loggong framework where stack traces are common. As I noted on my SO answer, there is no native way for logrus do this. This is not a shortcoming of Logrus. Errors in Go are not exceptions like in Java. The answer you purpose leaks the abstraction of pkg/errors. The goal was to hook into Logrus behind the scenes to have it translate a pkg/error to a well formatted stack trace. I closed this issue once it was made clear that Logrus does not support this feature. Please stop addressing this issue. You are not helping. You are harassing. |
It's strange that you think offering help on an issue that affects us both is considered "harassment". That says a lot more about you than it does about my actions. |
How do I get the logger to print the stack trace from errors wrapped with pkg/errors?
What I've done so far is
All I see in the logs is the Error() string result. I do not see a stack trace.
I've searched around, but cannot find anything. Thank you.
The text was updated successfully, but these errors were encountered: