1

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?

1 Answers1

2

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.

Suzu Hirose
  • 272
  • 1
  • 9
  • I took a closer look into the 3rd party libraries and they are using a custom logger, not the standard package as I initially thought. – Raphael Khaykin Jun 30 '22 at 15:17