-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add logrus
hook for sending SkaffoldLogEvent
s
#6250
Add logrus
hook for sending SkaffoldLogEvent
s
#6250
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6250 +/- ##
==========================================
+ Coverage 70.84% 70.86% +0.02%
==========================================
Files 490 490
Lines 22123 22162 +39
==========================================
+ Hits 15673 15706 +33
- Misses 5434 5440 +6
Partials 1016 1016
Continue to review full report at Codecov.
|
@@ -40,7 +43,7 @@ func (l logger) Write(p []byte) (int, error) { | |||
handler.handleSkaffoldLogEvent(&proto.SkaffoldLogEvent{ | |||
TaskId: fmt.Sprintf("%s-%d", l.Phase, handler.iteration), | |||
SubtaskId: l.SubtaskID, | |||
Level: 0, | |||
Level: -1, |
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.
what does the level -1
represent?
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.
this is basically just to avoid marking normal output with a level, since they technically don't have one as they don't come from any logging library. I wasn't sure how to best represent this. I can put it in a variable to make things clear or leave a comment to clarify if you think that's best
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.
just a comment should suffice
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.
lgtm
Nice!
|
Related: #5368
Description
This PR adds an implementation of a
logrus.Hook
type that will fire offSkaffoldLogEvent
s whenever we make calls to variouslogrus.Debug()
,logrus.Info()
, etc. functionsFollow-up work
Do some tracking of execution state in
handler
so that we can do some better setting ofTaskId
andSubtaskId
in these events.