This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
logging: Ensure errors are logged correctly. #27
Merged
Merged
Conversation
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
grahamwhaley
approved these changes
Mar 22, 2018
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.
also some sort of loop deref cleanup, and a typo fix....
lgtm
Fix typo. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel
force-pushed
the
fix-error-logging
branch
from
March 22, 2018 13:42
9594e17
to
eff28d6
Compare
Not sure what you mean about the loop cleanup, but created a separate commit for the typo. |
just this little bit and its friends didn't feel directly needed by the Error work, that's all: - nextKnob := ksmThrottleIntervals[k.currentKnob].nextKnob
- interval := ksmThrottleIntervals[k.currentKnob].interval
+ currentKnob := k.currentKnob
+ nextKnob := ksmThrottleIntervals[currentKnob].nextKnob
+ interval := ksmThrottleIntervals[currentKnob].interval |
Ensure all errors are logged using the `logrus.WithError()` API. The current `logrus.Error(err)` calls will result in log messages containing the following fields: ``` level=error msg="..." ``` Whereas using `logrus.WithError()` will result in the expected: ``` level=error error="..." ``` Fixes kata-containers#26. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Supplement the existing logs when errors occur with further structured log fields. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel
force-pushed
the
fix-error-logging
branch
from
March 22, 2018 14:13
eff28d6
to
44ccd8f
Compare
Better now? |
grahamwhaley
approved these changes
Mar 22, 2018
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.
yep - thanks (I was only noting you know...)
amshinde
approved these changes
Apr 4, 2018
sboeuf
approved these changes
Apr 11, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Ensure all errors are logged using the
logrus.WithError()
API.The current
logrus.Error(err)
calls will result in log messagescontaining the following fields:
Whereas using
logrus.WithError()
will result in the expected:Fixes #26.
Signed-off-by: James O. D. Hunt james.o.hunt@intel.com