-
Notifications
You must be signed in to change notification settings - Fork 272
Open
Description
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!
Metadata
Metadata
Assignees
Labels
No labels