moby / buildkit

concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
https://github.com/moby/moby/issues/34227
Apache License 2.0
7.85k stars 1.09k forks source link

remove some redundant imports of github.com/sirupsen/logrus #5024

Open thaJeztah opened 3 weeks ago

thaJeztah commented 3 weeks ago

remove uses of logrus.Fields

logrus.Fields is a map[string]any, so we don't need the logrus import in these places.

containerd/log aliases the type, which could be an alternative, but the containerd/log module is not used in many places, so would be a bit redundant just for this type.

examples: remove uses of logrus

These are very basic examples, so stdlib's "log" package should be fine for purpose of illustration.

thaJeztah commented 1 week ago

@tonistiigi bklog may be a wrapper around logrus, but with logrus being effectively unmaintained we should eventually consider moving to something else. Similar to work that has been done in containerd, I'm trying to already reduce locations where it's imported directly, so that if we decide to switch to something else, we are already prepared. And with our complex dependency tree, it can help to already reduce those imports.

In this case, the logrus imports didn't add anything, so replacing them seemed like the right thing to do.

thaJeztah commented 5 days ago

@tonistiigi any strong objections against this one?