Hi I have multiple GoLang Services with multiple OSS dependencies/modules, some of these dependencies might provide a way for change logging levels etc. some might not. I am looking for a way which can apply globally to all these dependencies and disable all logging from these packages/modules except the Error (STDERR) logs.
I tried setting log flag to 0 and log.SetOuput(io.Discard) however it do not work for dependencies and only disable logs in current application module.
I also tried to intercept the stdout logs by Pipe through the stdout stream (os.Pipe), however there also it only captures the current module’s stdout it seems and the dependencies modules logs flows without getting intercepted, it was a little confusing, do every module in GoLang has it’s own stdout and stderr streams ?
Is there a global way top solve this problem ?