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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add log-level filtering methods and associated refactoring: #12
Add log-level filtering methods and associated refactoring: #12
Changes from 46 commits
398c23f
2292781
f69ee31
5b74422
8749844
782dd13
856ce4a
2937d8f
95379d6
773020f
b965d98
5b31d01
fbb3f7b
30e76a0
d878399
d2e3d1d
b1f1afd
0b3dd23
a1df31c
c3d13be
14d4977
f4d2fd8
cf093ee
09656b4
65a788f
ca2a0eb
a912eeb
b7c28c9
8f81a51
5be8974
fce620e
47b9fed
cf8c036
e8b732c
a273e33
0a09a45
ed140f1
81e7739
e967005
55dabd4
bd0371a
1c4ab88
2b946ba
c04d887
bab5036
b3fde47
7564280
7d01cf2
bd29b8f
a244f5e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Check for Potential Memory Allocation Issues
Reserving space for
500,000
log events withm_encoded_log_events.reserve(cDefaultNumReservedLogEvents);
could lead to high memory usage. Consider assessing typical usage scenarios to determine if this number is appropriate or if a smaller initial capacity would suffice.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not intentional, let's revert this line removal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle Empty or Short
logtype
CorrectlyIn the log level extraction logic, ensure that
logtype
with length equal tocLogLevelPositionInMessages
is handled appropriately. Currently, iflogtype
is exactly one character long,logtype.substr(cLogLevelPositionInMessages)
results in an empty string, which may not be intended. Consider adjusting the condition:This change ensures that even log types of minimal valid length are processed correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the Index Range Check in
decode_range
The condition
if (length < end_idx || begin_idx > end_idx)
may lead to unexpected behaviour. To ensure proper bounds checking, consider updating the condition:This change verifies that
begin_idx
is less thanend_idx
and thatend_idx
does not exceed the total length, preventing potential out-of-bounds errors.