Skip to content

Conversation

@gauravkghildiyal
Copy link
Member

@gauravkghildiyal gauravkghildiyal commented Oct 10, 2025

The NRI library uses its own logger interface, which defaults to logrus. To ensure consistent logging with the rest of the dranet components that use klog, this change introduces a klog-based logger for NRI.

Depends on containerd/nri#239 to take affect (but doesn't break in it's absence)

The NRI library uses its own logger interface, which defaults to logrus. To
ensure consistent logging with the rest of the dranet components that use klog,
this change introduces a klog-based logger for NRI.
logger klog.Logger
}

func (l *nriLogger) Debugf(ctx context.Context, format string, args ...interface{}) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need contexts for these? I don't see that in klog from what I can tell, e.g https://pkg.go.dev/k8s.io/klog/v2#Errorf

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK klog and logr normally take context on constructing a logger, not on individual logf style calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants