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

Add callback/Observer for incoming/outgoing frames #25

Closed
rs200x opened this issue Nov 27, 2018 · 4 comments
Closed

Add callback/Observer for incoming/outgoing frames #25

rs200x opened this issue Nov 27, 2018 · 4 comments
Milestone

Comments

@rs200x
Copy link

rs200x commented Nov 27, 2018

Hi,

with the new version 7 and the changed configuration of the debug mode, I can't see the message content/body in the console log anymore!

"<<< MESSAGE
content-length:139
message-id:e452c40a-9ae9-727c-208a-8c7ca0859f8a-304
subscription:sub-10
content-type:application/json;charset=UTF-8
destination:/topic/nodes/ports/state
content-length:139

"

Is this by design?

I used the default configuration as described in the migration guide.

// Will log diagnostics on console
      // It can be quite verbose, not recommended in production
      // Skip this key to stop logging to console
      debug: (str) => {
        console.log(new Date(), str);
      }

What can I do to see the content and to aviod extra log lines?

Regards,
Robert

@kum-deepak
Copy link
Member

The version 7 added support for binary messages. It is not possible to determine whether a received frame has binary data in an efficient way (inefficient way being trying to process a frame assuming it to be UTF8 text and switch back to binary if it fails).

It was considered to add a callback to tap sent/received raw frames; which can be used to log messages.

Currently no way to log frame data in this version.

The change is needed in underlying @stomp/stompjs first.

@akuhtz
Copy link

akuhtz commented Nov 28, 2018

Hello Deepak,
Thank you for providing and maintaining this great library.
I hope you will find the time add this callback because it would be a great help in case of errors.

@kum-deepak kum-deepak changed the title No content in debug message Add callback/Observer for incoming/outgoing frames Nov 28, 2018
@kum-deepak kum-deepak transferred this issue from stomp-js/ng2-stompjs Dec 17, 2018
@kum-deepak kum-deepak added this to the 0.2.0 milestone Dec 17, 2018
@kum-deepak
Copy link
Member

Added logRawCommunication in configuration options, when set to true, body of the frames will be logged as well. It assumes body to only have valid UTF8 chars.

@kum-deepak
Copy link
Member

It will be part of next public release.

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

No branches or pull requests

3 participants