Skip to content

capnslog: deprecation notice #57

Description

@tmrts

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

Activity

  1. philips commented on May 2, 2016

    @philips

    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.

  2. ericchiang commented on May 2, 2016

    @ericchiang
    Contributor

    Should be easy for go-oidc. Not particularly picky about which logging package we use.

  3. tmrts commented on May 2, 2016

    @tmrts
    Author

    Also we should create a wrapper interface around Logrus and use that for our projects,
    which would make it easy to replace Logrus and add more features to it.

    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

  4. Quentin-M commented on May 2, 2016

    @Quentin-M

    @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.

  5. chancez commented on May 2, 2016

    @chancez
    Contributor
  6. xiang90 commented on May 2, 2016

    @xiang90

    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?

  7. tmrts commented on May 6, 2016

    @tmrts
    Author

    @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 log.Level wasn't Debug.

    Also we should name it something short and not advise people to rename this package to log it causes problems to goimports, etc. Something like clog, coslog, corelog would be good, or a better suggestion

  8. purpleidea commented on Mar 15, 2017

    @purpleidea
    Contributor

    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 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.

  9. jonboulle commented on Mar 15, 2017

    @jonboulle
    Contributor
  10. changed the title [-]Deprecate capnslog in favor of Logrus[/-] [+]capnslog: deprecation notice[/+] on Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions