-
Notifications
You must be signed in to change notification settings - Fork 3
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
Log invalid log levels, then default to 'debug' #216
Conversation
Prior to this change, an invalid log level passed to the FilteredLogLevelDecorator constructor would result in an InvalidArgumentException. This means that a mis- configured production system could fail to boot. This patch proposes that an invalid log level should not be a hard failure. The change logs the invalid log level to the 'realLogger' as an error, then sets the default log level to 'debug'.
@asgrim not clear to me why the Psalm checks failed; they don't fail on my dev machine, and they didn't fail in GitHub Actions on the files that I changed. I'll take a closer look at the Unit test failures in the next few days. |
I'll check next week too if not :) |
@asgrim hope this helps: SummaryQuality ChecksThe Psalm checks are behaving differently in CI than locally, and are only failing on files that are not modified by this PR. This is a separate issue and I recommend overriding this check and fixing it under a separate PR. Main TestsThese seem to be failing because of a missing secret, DetailsPsalmWhen I was running PHP 8.0.3 on my development machine I received no errors. The CI pipeline is currently using PHP 8.0.7, so I updated my PHP and I got six errors:
Again, none of these are in files I have modified. This is also a far cry from the 81 errors in CI. Out of curiosity, I used nektos/act to run the quality checks locally and I did get the same results that show up in GitHub Actions, but I did not consider investigating why. |
The static analysis issues come from Composer deciding to add type annotations somewhere between Composer 2.0.8 and 2.1.1 - previously there were not types defined, so I consumed the interface accordingly (cast to a type I expected). Now types are defined correctly in Composer (I didn't check exactly since when), we got redundant type conversions, and also one method I expected Thank you so much @pjohnmeyer - the change itself was 👌 just an unexpected dependency issue slipped in :) As for secrets not being available in PRs, that is indeed an issue. I'll have to look into how we can improve that in future (created #218). |
Thanks for doing the remaining legwork to get this incorporated, @asgrim -- much appreciated. We will look forward to the next package release! |
@pjohnmeyer I've just released 6.2.0 with this fix in, thank you! https://github.com/scoutapp/scout-apm-php/releases/tag/v6.2.0 |
Prior to this change, an invalid log level passed to the FilteredLogLevelDecorator
constructor would result in an InvalidArgumentException. This means that a mis-
configured production system could fail to boot.
This patch proposes that an invalid log level should not be a hard failure. The
change logs the invalid log level to the 'realLogger' as an error, then sets the
default log level to 'debug'.