-
Notifications
You must be signed in to change notification settings - Fork 51
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 disable stack trace in wrn and err level ? #27
Comments
If you generally want to supress stack traces on specific logger calls you can always pass the error message instead of the entire error:
|
unfortunately log.Error always generate stack trace :(, your method worked only with warning. |
Please consider adding an option to disable automatic stacktraces with the HappyDevFormatter. The traces generated by debug.Stack are quite useless. Consider this program: package main
import (
"errors"
"github.com/mgutz/logxi/v1"
)
func main() {
err := f()
log.Info("fatal", "err", err)
}
func f() error {
return g()
}
func g() error {
return errors.New("fail")
} The automatic trace is something like
This mentions neither f, nor g. There are packages that provide much more relevant traces, such as github.com/pkg/errors. When I log these traces explicitly the automatic traces are confusing.
|
Hello, i need to disable stack trace in WRN and ERROR level, how to do this ?
The text was updated successfully, but these errors were encountered: