Logging in lazy sequences may interfere with output of Content-Type: application/edn #131
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.
The case addressed in this PR is the following:
map
of some functionfunction-with-logs
on some range).function-with-logs
does some logging (either withprn
s or withclojure.tools.logging
)edn
output is mixed with the output of the logging in lazy sequence.This can be easily avoided if all such responses are realised with a
doall
, so this pull request might not be a case at all. Forgetting to realise the sequences can, however, result in hard to spot errors.The solution is not optimal, since it essentially replicates the functionality of
pr
andpr-on
fromclojure.core
. Perhaps it should also include some tests fromclojure.core
to ensure that the function remains consistent withpr-str
.Commits: