Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Log raw WS messages to facilitate the debugging #195

Closed
wants to merge 2 commits into from

Conversation

MOZGIII
Copy link
Contributor

@MOZGIII MOZGIII commented Dec 18, 2023

No description provided.

Copy link
Owner

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I'm okay with logging these without a new feature

@MOZGIII
Copy link
Contributor Author

MOZGIII commented Dec 18, 2023

I'd like to be able to turn these off though, as it's an extra copy on every message; would you consider keeping a feature but making it on by default? That way I can turn it off when needed.

I'm kind of interested in tuning performance here, as we could have a quite overhead-sensitive setup (proper measurements to confirm this are pending).

@ryo33
Copy link
Contributor

ryo33 commented Feb 14, 2024

I'd like to be able to turn these off though, as it's an extra copy on every message; would you consider keeping a feature but making it on by default? That way I can turn it off when needed.

Extra cloning can be avoided by this statement.

let msg_for_debug = if tracing::enabled!(target: "chromiumoxide::conn::raw_ws::parse_errors", tracing::Level::DEBUG) {
    Some(msg.clone)
} else {
    None
};

@ryo33
Copy link
Contributor

ryo33 commented Feb 14, 2024

I forked this branch and opened #204.
It's zero-copy.

mattsse pushed a commit that referenced this pull request Feb 14, 2024
…age enum (#204)

* Log raw WS messages to facilitate the debugging

* Add debug-raw-ws-messages feature

* Emit an error on WsMessage::Text fails to be parsed

* Wake the task before returning Poll::Pending

---------

Co-authored-by: MOZGIII <mike-n@narod.ru>
@MOZGIII MOZGIII closed this Feb 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants