Skip to content
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

fix: logify could panic if truncating mid-code point #70

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

keelerm84
Copy link
Member

No description provided.

@keelerm84 keelerm84 requested a review from a team December 7, 2023 17:22
Copy link

This pull request has been linked to Shortcut Story #226261: Fix logify panic in rust eventsource.

@@ -79,13 +79,9 @@ pub struct Event {
}

const LOGIFY_MAX_CHARS: usize = 100;
fn logify(bytes: &[u8]) -> &str {
fn logify(bytes: &[u8]) -> String {
Copy link
Member

Choose a reason for hiding this comment

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

At the default logging level how often do we call this function?

Copy link
Member Author

Choose a reason for hiding this comment

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

We only call this method for trace and debug, so it shouldn't be executed at all with a default logging configuration, I wouldn't think.

Wanting to drop this truncation functionality entirely?

Copy link
Member

Choose a reason for hiding this comment

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

I was just checking that it wasn't all the time. I am down with this change.

Copy link
Member

Choose a reason for hiding this comment

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

I do think we should consider an alternative longer term. (dropping it and doing it in a logger or something.)

@keelerm84 keelerm84 requested a review from kinyoklion December 11, 2023 15:13
@keelerm84 keelerm84 merged commit 37316c4 into main Dec 12, 2023
2 checks passed
@keelerm84 keelerm84 deleted the mk/sc-226261/logify branch December 12, 2023 14:11
keelerm84 pushed a commit that referenced this pull request Dec 12, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.12.1](0.12.0...0.12.1)
(2023-12-12)


### Bug Fixes

* logify could panic if truncating mid-code point
([#70](#70))
([37316c4](37316c4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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