-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
capnslog: deprecation notice #57
Comments
We would need to fixup clair, etcd, and go-oidc. https://godoc.org/github.com/coreos/pkg/capnslog?importers cc @xiang90 @Quentin-M @ericchiang for their opinions. |
Should be easy for go-oidc. Not particularly picky about which logging package we use. |
Also we should create a wrapper interface around Logrus and use that for our projects, As long as we don't use reflection in the wrapper, there should be no resource overhead. Maybe with the pkg name "clog" for CoreOS Log |
@jsqware and I already discussed about replacing capnslog by logrus very recently. The only con was that capnslog is the one that every CoreOS project use. |
@tmrts Would one of these interfaces work? https://github.com/Sirupsen/logrus/blob/master/logrus.go#L97-L143 |
For etcd, people might want to control the pkg level logging when they embed etcd server into their own projects. Is this something easy to do in logrus? |
@chancez That is an idiomatic interface. It would be fine. But, I'd suggest going one step forward, consider the following example: m, err := p.FetchMetadata()
if err != nil {
log.Fatal("Failed to fetch meta-data from pod",
log.Fields{
Event: "k8s.Pod.FetchMetadata",
Error: err,
},
log.Details{
"pod": p,
},
)
} Advantage would be consistent log messages and they would provide actionable & meaningful information. Developers wouldn't be thinking how to format the messages and it wouldn't resemble a stack dump after a crash to bug hunters. The underlying logging library would be Logrus in this case, but it can be the stdlib logging library just as well. And the log.Details would be discarded if Also we should name it something short and not advise people to rename this package to |
Above @xiang90 makes an excellent point. This is what we have to do in mgmt to avoid log pains due to capnslog: https://github.com/purpleidea/mgmt/blob/master/lib/main.go#L186 I like the suggestion of using an internal (to etcd) interface to control logs, and whether that uses logrus or logfoo or whatever is hidden to the user embedding etcd. |
I think we reached consensus a while ago on removing capnslog but just
haven't allocated any time to do the migration work involved...
…On 15 March 2017 at 09:52, James ***@***.***> wrote:
For etcd, people might want to control the pkg level logging when they
embed etcd server into their own projects. Is this something easy to do in
logrus?
Above @xiang90 <https://github.com/xiang90> makes an excellent point.
This is what we have to do in mgmt to avoid log pains due to capnslog:
https://github.com/purpleidea/mgmt/blob/master/lib/main.go#L186
I like the suggestion of using an internal (to etcd) interface to control
logs, and whether that uses logrus or logfoo or whatever is hidden to the
user embedding etcd.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#57 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACewNxXp9ScOxligyqtKPCU4hJF-Gnt7ks5rl6bXgaJpZM4IVJg4>
.
|
The point of this issue is to have a discussion about moving on from capnslog to a better alternative Logrus, which is a well developed structured & pluggable logging library.
cc @philips
The text was updated successfully, but these errors were encountered: