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.
Implements a new option to the format builder to make the header on logs display the file and line number a log originated from.
I work on a project (a binary) that uses this library and we often have trouble identifying where scattered warnings / debug messages are actually being fired from. The specificity of files + line numbers is more helpful for us, who will never have these logs displayed to an end-user.
I tried to implement this with as small of a footprint as possible, but that does lead to a bit of weirdness with the relationship between the new
format_file_location
andformat_module_path
, since they both want control over the header. I have just made it so that attempting to enable both will print out a warning that you can't and then rejects the second request. A more elegant way of handling this may be creating a type that can contain both behaviors (leading to something likeformat_header_style(HeaderStyle::ModulePath)
, but I don't love the idea of users having to import a new type.