go-logging
go-logging copied to clipboard
Question: Can you set maximum logging level
Hello,
I am trying to accomplish a logging on different channel depending on the level of the log.
- If logging level is
<= Warning, then log tostdout - if logging level is
>= Error, then log tostderr
Is there a way to get this work ?
For now I got
backend := logging.NewLogBackend(os.Stdout, "", 0)
leveledConsoleBackend = logging.AddModuleLevel(backend)
// ...
errorBackend := logging.NewLogBackend(os.Stderr, "", 0)
leveledConsoleErrorBackend = logging.AddModuleLevel(errorBackend)
leveledConsoleErrorBackend.SetLevel(logging.ERROR, "")
logging.SetBackend(leveledConsoleErrorBackend, leveledConsoleBackend)
But with this, I see error logs output both in Stdoud and Stderr
Thank you for your help!
I opened a ticket in July lol, waiting for a response :(