Skip to content

Conversation

@jonyhy96
Copy link
Contributor

@jonyhy96 jonyhy96 commented Dec 3, 2021

Currently, it will print path only when error happens. Add log when success record path could help to see which file will be prefetched

@jonyhy96
Copy link
Contributor Author

jonyhy96 commented Dec 3, 2021

PTAL @ktock

if err := rc.Record(path); err != nil {
log.G(ctx).WithError(err).Debugf("failed to record %q", path)
}
log.G(ctx).Debugf("success record path %q", path)
Copy link
Member

@ktock ktock Dec 3, 2021

Choose a reason for hiding this comment

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

You can get the full list of recorded path using --record-out option.

Instead of printing all paths, can we just print the succeeded message with the number of recorded paths just before this go func returns?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, do u think we should add use with --record-out option to see details with the log?

go func() {
var successCount int
defer func() {
log.G(ctx).Debugf("success record %d path", successCount)
Copy link
Member

@ktock ktock Dec 3, 2021

Choose a reason for hiding this comment

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

(nit)

Suggested change
log.G(ctx).Debugf("success record %d path", successCount)
log.G(ctx).Debugf("recorded %d path", successCount)

@ktock
Copy link
Member

ktock commented Dec 3, 2021

Thanks

@ktock ktock merged commit 75e2fcf into containerd:main Dec 3, 2021
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.

2 participants