Conversation
Just like for ILogger we should have a version that has the app ID pre-set for the context (unless overwritten) so that each log entry can be traced back to the app that produced it. Signed-off-by: Christoph Wurst <[email protected]>
kesselb
left a comment
There was a problem hiding this comment.
LGTM. I find array_merge a bit heavy given that the first array is always the same. !isset($context[app]) add app id would work as well.
Is that really slower? I've tried to test this a bit at https://3v4l.org/Y9Wd0/perf#output but the |
I don't have a strong opinion on that ;) But your benchmark shows that isset is faster 🤔 (I usually add system and user time as per https://stackoverflow.com/a/556411). |
Just like for ILogger we should have a version that has the app ID
pre-set for the context (unless overwritten) so that each log entry can
be traced back to the app that produced it.
This adds a decorator that does just this.
Next step will be to deprecate ILogger 😈 🔥 💣