FW logs parser should parse :f format as 32 bit float - #12652
Merged
Conversation
Nir-Az
reviewed
Feb 11, 2024
| st_regular_exp[2] << "\\{\\b(" << i << "):f\\}"; | ||
| regular_exp[2] = st_regular_exp[2].str(); | ||
| st_replacement[2] << params[i]; | ||
| st_replacement[2] << *reinterpret_cast< const float * >( ¶ms[i] ); // Parse as 4 raw bytes of float |
Collaborator
There was a problem hiding this comment.
Can we add some std check of is_floating_point?
https://en.cppreference.com/w/cpp/types/is_floating_point
Contributor
Author
There was a problem hiding this comment.
I don't think is_floating_point will help in this case. std::isfinite is more appropriate here (https://en.cppreference.com/w/cpp/numeric/math/isfinite).
If you want I will add a check. If it is not finite, should I print as decimal int, hexadecimal int or throw?
Collaborator
There was a problem hiding this comment.
Not sure what a thrown will cause here, but maybe we can LOG_ERROR and print as HEX?
OhadMeir
force-pushed
the
development
branch
from
February 12, 2024 10:30
05675cf to
615e36f
Compare
OhadMeir
force-pushed
the
development
branch
from
February 12, 2024 11:55
615e36f to
a32919d
Compare
Nir-Az
approved these changes
Feb 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Current parser have no difference between
{0}and{0:f}formats in the xml