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.
Issue #165
Changelog (TODO)
Pull requests will not be accepted without a description of this change under the
[unreleased]
sectionin the file
CHANGELOG
.Description of changes
Note: This isn't quite ready for prime yet but raising the draft early for some feedback and discussion.
I've taken an initial stab at this with the goal of adding the discussed functionality without breaking existing API or behavior. The proposed ideas seem to slot in nicely with current functionality in such a way that I wouldn't expect anything to break.
However, there's something I wanted to raise which I had initially taken for a given that actually turned out to be a little unintuitive, in my opinion.. This is very much an API design consideration, so your input would be valuable @reidmorrison.
Consider the following:
As the PR currently is,
"test"
would contain bothtest
andimportant
while"doing something"
would only containimportant
. This is aligned with what was discussed in the issue and it kind of makes sense. However, what got me thinking was the fact that we called#tagged
on the logger instance here, which my intuition tells me would have an additive effect on the tags already set at the logger level. In other words, add to the logs within the block, any logs already present in the logger in addition to these i'm providing now.This intuition comes from the fact that this is how things currently work today. Of course this comes from the fact that the only other tags that exist in addition to those passed to
#tagged
are those already set at the thread level. But if we are introducing this "third layer", we need to decide on which makes more sense.As it currently stands, I don't know if theres much practical difference in using
logger.tagged
vsSemanticLogger.tagged
, so I think we have two options iftagged
is called on the logger:tagged
, regardless of the receiver.tagged
tags to the logger's own logs.I think either of the two would help in keeping things consistent, though the second option would obviously be a bit more work and would definitely break current behavior.
Frankly I don't know which is better and like I mention, this is more of a design consideration. Personally I feel like the first option is the way to go, but there's a very possible chance I'm missing part of the puzzle here, so any input would be appreciated.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.