-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Description
The question was raised whether we ought to break out the various logging backends to their own packages underneath package log, similar to package metrics. I was initially for the idea, but in mocking out the UX, realized it would have the effect of changing the relatively-nice
import (
"github.com/go-kit/kit/log"
)
var logger log.Logger
logger = log.NewJSONLogger(os.Stdout)
logger = log.NewContext(logger).With("foo", 123)
to the slightly more awkward
import (
"github.com/go-kit/kit/log"
jsonlog "github.com/go-kit/kit/log/json"
)
var logger log.Logger
logger = jsonlog.New(os.Stdout)
logger = log.NewContext(logger).With("foo", 123)
The same critique applies to package metrics, but in that case we have considerably different construction semantics for each of the backends. In this case, packages seem to act purely as namespaces, which I guess is an antipattern.
Thoughts?
Reactions are currently unavailable