-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: refact daemon log #2324
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,12 +94,12 @@ func (c *CriWrapper) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodS | |
|
||
// PodSandboxStatus returns the status of the PodSandbox. | ||
func (c *CriWrapper) PodSandboxStatus(ctx context.Context, r *runtime.PodSandboxStatusRequest) (res *runtime.PodSandboxStatusResponse, err error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So strange to see using a defer to cover a simple error asserting. 😆 |
||
logrus.Infof("PodSandboxStatus for %q", r.GetPodSandboxId()) | ||
logrus.Debugf("PodSandboxStatus for %q", r.GetPodSandboxId()) | ||
defer func() { | ||
if err != nil { | ||
logrus.Errorf("failed to get PodSandboxStatus: %q, %v", r.GetPodSandboxId(), err) | ||
} else { | ||
logrus.Infof("success to get PodSandboxStatus: %q, %+v", r.GetPodSandboxId(), res.GetStatus()) | ||
logrus.Debugf("success to get PodSandboxStatus: %q, %+v", r.GetPodSandboxId(), res.GetStatus()) | ||
} | ||
}() | ||
return c.CriManager.PodSandboxStatus(ctx, r) | ||
|
@@ -191,12 +191,12 @@ func (c *CriWrapper) ListContainers(ctx context.Context, r *runtime.ListContaine | |
|
||
// ContainerStatus inspects the container and returns the status. | ||
func (c *CriWrapper) ContainerStatus(ctx context.Context, r *runtime.ContainerStatusRequest) (res *runtime.ContainerStatusResponse, err error) { | ||
logrus.Infof("ContainerStatus for %q", r.GetContainerId()) | ||
logrus.Debugf("ContainerStatus for %q", r.GetContainerId()) | ||
defer func() { | ||
if err != nil { | ||
logrus.Errorf("failed to get ContainerStatus: %q, %v", r.GetContainerId(), err) | ||
} else { | ||
logrus.Infof("success to get ContainerStatus: %q, %+v", r.GetContainerId(), res.GetStatus()) | ||
logrus.Debugf("success to get ContainerStatus: %q, %+v", r.GetContainerId(), res.GetStatus()) | ||
} | ||
}() | ||
return c.CriManager.ContainerStatus(ctx, r) | ||
|
@@ -205,12 +205,12 @@ func (c *CriWrapper) ContainerStatus(ctx context.Context, r *runtime.ContainerSt | |
// ContainerStats returns stats of the container. If the container does not | ||
// exist, the call returns an error. | ||
func (c *CriWrapper) ContainerStats(ctx context.Context, r *runtime.ContainerStatsRequest) (res *runtime.ContainerStatsResponse, err error) { | ||
logrus.Infof("ContainerStats for %q", r.GetContainerId()) | ||
logrus.Debugf("ContainerStats for %q", r.GetContainerId()) | ||
defer func() { | ||
if err != nil { | ||
logrus.Errorf("failed to get ContainerStats: %q, %v", r.GetContainerId(), err) | ||
} else { | ||
logrus.Infof("success to get ContainerStats: %q, %+v", r.GetContainerId(), res.GetStats()) | ||
logrus.Debugf("success to get ContainerStats: %q, %+v", r.GetContainerId(), res.GetStats()) | ||
} | ||
}() | ||
return c.CriManager.ContainerStats(ctx, r) | ||
|
@@ -311,12 +311,12 @@ func (c *CriWrapper) UpdateRuntimeConfig(ctx context.Context, r *runtime.UpdateR | |
|
||
// Status returns the status of the runtime. | ||
func (c *CriWrapper) Status(ctx context.Context, r *runtime.StatusRequest) (res *runtime.StatusResponse, err error) { | ||
logrus.Infof("Status of cri manager") | ||
logrus.Debugf("Status of cri manager") | ||
defer func() { | ||
if err != nil { | ||
logrus.Errorf("failed to get status: %v", err) | ||
} else { | ||
logrus.Infof("success to get status: %+v", res.GetStatus()) | ||
logrus.Debugf("success to get status: %+v", res.GetStatus()) | ||
} | ||
}() | ||
return c.CriManager.Status(ctx, r) | ||
|
@@ -338,12 +338,12 @@ func (c *CriWrapper) ListImages(ctx context.Context, r *runtime.ListImagesReques | |
|
||
// ImageStatus returns the status of the image, returns nil if the image isn't present. | ||
func (c *CriWrapper) ImageStatus(ctx context.Context, r *runtime.ImageStatusRequest) (res *runtime.ImageStatusResponse, err error) { | ||
logrus.Infof("ImageStatus for %q", r.GetImage().GetImage()) | ||
logrus.Debugf("ImageStatus for %q", r.GetImage().GetImage()) | ||
defer func() { | ||
if err != nil { | ||
logrus.Errorf("failed to get ImageStatus: %q, %v", r.GetImage().GetImage(), err) | ||
} else { | ||
logrus.Infof("success to get ImageStatus: %q, %+v", | ||
logrus.Debugf("success to get ImageStatus: %q, %+v", | ||
r.GetImage().GetImage(), res.GetImage()) | ||
} | ||
}() | ||
|
@@ -379,12 +379,12 @@ func (c *CriWrapper) RemoveImage(ctx context.Context, r *runtime.RemoveImageRequ | |
|
||
// ImageFsInfo returns information of the filesystem that is used to store images. | ||
func (c *CriWrapper) ImageFsInfo(ctx context.Context, r *runtime.ImageFsInfoRequest) (res *runtime.ImageFsInfoResponse, err error) { | ||
logrus.Infof("ImageFsInfo of cri manager") | ||
logrus.Debugf("ImageFsInfo of cri manager") | ||
defer func() { | ||
if err != nil { | ||
logrus.Errorf("faild to get ImageFsInfo: %v", err) | ||
} else { | ||
logrus.Infof("success to get ImageFsInfo, return filesystem info %+v", res.GetImageFilesystems()) | ||
logrus.Debugf("success to get ImageFsInfo, return filesystem info %+v", res.GetImageFilesystems()) | ||
} | ||
}() | ||
return c.CriManager.ImageFsInfo(ctx, r) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decode metrics log level keep as
Error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1