-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: add step name to logger field #1027
Conversation
This change does add the step name to the logger fields. This does not change the output for our users, but for the json logger, it does make each step output traceable.
Codecov Report
@@ Coverage Diff @@
## master #1027 +/- ##
==========================================
+ Coverage 57.50% 58.77% +1.26%
==========================================
Files 32 34 +2
Lines 4594 4655 +61
==========================================
+ Hits 2642 2736 +94
+ Misses 1729 1690 -39
- Partials 223 229 +6
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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 doesn't seem to work for me.
Also every step no longer prints via the job logger.
Right, the step should log through the step-logger. |
Yes I use a custom one, since I send the log to github actions service no logging to stdout. |
So, the problem is that a different logger is used. Can't you set the output on the root logger? That should then be used by all context loggers and redirect as you wish |
No, this PR overrides everything I set:
The other if case is always skipped during debugging of this PR |
Since I don't know your code, I cannot even think of another way to do it. Can you reference your code lines here? |
here I set my custom logger before I call act https://github.com/ChristopherHX/act/blob/cd5e0e29fd725880b4cf58f315f6c791450bf266/pkg/agent/main.go#L1691 |
Since logrus and context both are immutable for our case, we can just add a new field and store the logger in the context.
@KnisterPeter this pull request has failed checks 🛠 |
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.
All fine now, I can confirm that you no longer notice the change without a json logger or a debugger.
@KnisterPeter this pull request is now in conflict 😩 |
002f989
@KnisterPeter this pull request has failed checks 🛠 |
This change does add the step name to the logger fields. This does
not change the output for our users, but for the json logger, it
does make each step output traceable.