-
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
Separate console logger for plugins #2837
Separate console logger for plugins #2837
Conversation
143808b
to
0b6ad84
Compare
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.
It would be great to add some unit test coverage for this. For example we could set output on the plugin logger and check if the decisions/status are being logged.
@ashutosh-narkar yeah I thought about that, but would it not essentially just be repeating the e2e test in a unit test format? I don't know too much about how codecov works, but does it not take all test types into account when calculating coverage? |
Re. codecov, me neither 🤷♂️ . I was thinking about a test where we set the regular logger to say |
That's pretty much what we do, no? Oh well, I'll add a unit test for the status plugin since console logging seems untested there and thus we won't have to repeat the same test in another format. That should give us some codecov points too :) |
My bad I missed that line. Sounds good. Thanks ! |
0b6ad84
to
c4b598f
Compare
This allows logging to console for decisions and status (and possibly other use cases) without having to follow the generic --log-level. Fixes open-policy-agent#2733 Signed-off-by: Anders Eknert <anders.eknert@bisnode.com>
c4b598f
to
44cb167
Compare
Unit test added. While it's good to have nonetheless it didn't do much in terms of pleasing codecov. I'm honestly lost here as the change itself is minimal, and all lines added are tested as far as I can tell. |
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
@patrick-east PTAL |
This allows logging to console for decisions and status (and possibly other use cases) without having to follow the generic --log-level.
Fixes #2733
Signed-off-by: Anders Eknert anders.eknert@bisnode.com