-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Disable warning for debug mode #1346
Comments
It tell us: now debug mode and how switch release mode.
|
Yeah, but you pretty much know when you're in debug mode, and you can google how to get to production mode. It is one more garbage thing you have to ignore when you're developing. At least make it an option to disable it. |
It is just as the option to suppress debugging logs -- Or you just go run /tmp/test.go 2>&1 | egrep -v 'Running in "debug" mode|using (env|code)' gin shows various debugging logs and it is not good to add an option to ignore each log individually... |
if you want to close tips of debug warning ,use this in your beginning gin.SetMode(gin.ReleaseMode) if you want to close logger middleware ,example : router := gin.New()
router.Use(gin.Recovery()) |
You can suppress the debug warning by overwriting the os.Stderr file descriptor temporarily before starting Gin, and then restoring it: stderr := os.Stderr
fd, _ := os.Open(os.DevNull)
os.Stderr = fd
r := gin.New()
os.Stderr = stderr This will redirect Gin's debug mode message to |
Fixed in #1891 (gin 1.5.0) |
Might be a side feature which unlikely to go through but I wonder if instead of:
We can just log this warning once through out one application lifecycle. |
I'm trying to develop using Gin, and I keep getting this warning
I don't care, and it is cluttering up my log, so I can't see the real errors. Is there a way to disable this "feature"?
The text was updated successfully, but these errors were encountered: