Skip to content

truncated message warning#41

Merged
turuslan merged 5 commits into
masterfrom
fix/truncated_message_warning
Oct 16, 2025
Merged

truncated message warning#41
turuslan merged 5 commits into
masterfrom
fix/truncated_message_warning

Conversation

@turuslan

Copy link
Copy Markdown
  • When message doesn't fit buffer, replace part of message with "message truncated" warning, suggesting max_message_length yaml config.
    • Discuss and choose warning message text and format during review

Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from xDimon October 15, 2025 08:13
Comment thread include/soralog/likely.hpp Outdated
Comment thread include/soralog/event.hpp Outdated
Comment thread include/soralog/event.hpp Outdated
auto warning_size =
warning.size()
+ ::fmt::detail::count_digits(static_cast<uint64_t>(message_size_));
UNLIKELY_IF(warning_size > max_message_length) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check up is redundant. We already check it in config, default value is 1024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't rely on config.
Must avoid underflow/overflow.
Removed second warning message.
Will truncate, e.g. <<< truncated; or

@turuslan turuslan requested a review from xDimon October 15, 2025 11:28
@turuslan turuslan merged commit c83dd11 into master Oct 16, 2025
9 checks passed
@turuslan turuslan deleted the fix/truncated_message_warning branch October 16, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants