You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This causes for the backend defined by the SetBackend method to be ignored unless set with the package method SetBackend; i.e:
package main
import (
"os""github.com/op/go-logging"
)
funcmain() {
formatter:=logging.MustStringFormatter("JUST A PREFIX: ${message}")
backend:=logging.NewLogBackend(os.Stdout, "", log.LstdFlags)
lg:=logging.MustGetLogger("example")
backendFormatter:=logging.NewBackendFormatter(backend, formatter)
leveled:=logging.AddModuleLevel(backendFormatter)
leveled.SetLevel(logging.DEBUG, "")
// The following will cause for the backend `leveled` to be ignored by `lg`lg.SetBackend(leveled)
// This will set the backend globallylogging.SetBackend(leveled)
}
The text was updated successfully, but these errors were encountered:
Whenever a new logger is created; it defaults to calling the global
defaultBackend
rather than it's ownbackend
.This causes for the backend defined by the
SetBackend
method to be ignored unless set with the package methodSetBackend
; i.e:The text was updated successfully, but these errors were encountered: