[8.x] allow tests to utilise the null logger #38785
Merged
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.
Note: maybe I'm way off here and don't know how to use the "null" logger - so maybe PEBKEC?
Currently, the "null" logger does not ever get utillised. It instead creates and writes to the emergency logger.
The issue being that when you set this in your env...
It is interpreted as
null
not"null"
. There is possibly a way to tell dot env to read this value as a string and I've tried to obvious ones, but didn't have any luck. I'm sure someone will jump in and tell me how, but I reckon a lot of people will have this set and it is triggering the emergency logger instead.Steps to reproduce the issue...
Hopefully the test is okay. I kinda felt like it would be good to have it all co-located rather than splitting out to atomic tests 🤷♂️
I didn't feel comfortable making this impact anything other than unit tests. Maybe this should also happen in production...but on the other hand if this is null in prod you probably really do want it to write to the emergency logger as a safe default.