Skip to content

Conversation

@mxpv
Copy link
Member

@mxpv mxpv commented Feb 21, 2023

When logging with custom fields, like:

log.G(ctx).WithFields(logrus.Fields{ ... })...

you're forced to do two imports

"github.com/containerd/containerd/log"
"github.com/sirupsen/logrus"

This PR adds a type alias to log package, so we end up with just one import:

"github.com/containerd/containerd/log"

log.G(ctx).WithFields(log.Fields{})

Which often reduces the number of imports and makes log package a bit nicer.

@mxpv mxpv added the easy-to-review Easy to review label Feb 21, 2023
@dcantah dcantah self-requested a review February 21, 2023 01:39
@fuweid fuweid merged commit 8cb00f4 into containerd:main Feb 21, 2023
dcantah added a commit to dcantah/containerd that referenced this pull request Feb 21, 2023
containerd#8143 added an alias for
logrus.Fields and moved over most usages to this alias, but there was
one straggler.

Signed-off-by: Danny Canter <[email protected]>
@mxpv mxpv deleted the log branch February 21, 2023 02:34
jsturtevant pushed a commit to jsturtevant/containerd that referenced this pull request Sep 21, 2023
containerd#8143 added an alias for
logrus.Fields and moved over most usages to this alias, but there was
one straggler.

Signed-off-by: Danny Canter <[email protected]>
juliusl pushed a commit to juliusl/containerd that referenced this pull request Jan 26, 2024
containerd#8143 added an alias for
logrus.Fields and moved over most usages to this alias, but there was
one straggler.

Signed-off-by: Danny Canter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

easy-to-review Easy to review

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants