Reputation: 23
I want to disable logs from various 3rd party libraries which a custom log package. I'm not able to modify the libraries directly or the log package. I've already looked at Disable logging for 3rd party library which suggests to redefine os.Stderr
as a custom io.Writer
. How do I implement the approach described here: https://stackoverflow.com/a/38832115/18024985?
Upvotes: 1
Views: 656
Reputation: 312
The question you have pointed to describes a different situation from yours, where a custom logger is being used. In your case, with the standard logger, you should use log.SetOutput
rather than redirecting os.Stderr
.
Upvotes: 2