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.
I came across an interesting bug while looking at particles vanishing from a PB-FHR geometry.
The write_message routine is called in particle.cpp as : write_message("some string with {}", surface_id).
The intent of this is to have surface_id be recognized as a parameter of the string, and the templated write_message() routine can handle it throught a call to fmt::format
Unfortunately, the routine that ends up being called is write_message("some_string", log_level), so surface_id is not shown on screen.
I can't see an easy fix on the error.cpp side. Excluding "int" as a valid parameter in the template takes a bit of code and will be a bit confusing since it's the most common use case for this template. On the other hand, being able to write_message without specifying a level is also very convenient, so we do want
int level=0
as an optional second parameter.Having the templated write_message have a different name also slightly defeats the purpose.
I fixed the symptoms by adding the level to the problematic write_message logs.
Note: An alternative "symptoms" fix is to make surface id be a int64_t, just like particle ids.