-
Notifications
You must be signed in to change notification settings - Fork 32
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 SIREPO.traceWS and better logging of ws messages #6250
Comments
4 tasks
Here's a simple implementation, which can be enabled on the client by typing "SIREPO.traceWS = true" in the javascript console. It logs the sequence number, url and data on the send, and sequence number, and either json content or content-type on replies: |
@@ -2093,6 +2093,15 @@ SIREPO.app.factory('msgRouter', ($http, $interval, $q, $window, errorService) =>
wsreq.deferred.reject("invalid reply from server");
return;
}
+ if (SIREPO.traceWS) {
+ srlog(
+ 'ws reply:',
+ header.reqSeq,
+ header.contentType == "application/json"
+ ? JSON.parse(content)
+ : `<${header.contentType} content>`,
+ );
+ }
wsreq.deferred.resolve({
data: header.contentType == "application/json" ? JSON.parse(content) : content,
status: header.httpStatus
@@ -2207,6 +2216,9 @@ SIREPO.app.factory('msgRouter', ($http, $interval, $q, $window, errorService) =>
if (wsreq.timeout) {
wsreq.timeout.then(() => {_remove(wsreq);});
}
+ if (SIREPO.traceWS) {
+ srlog('ws send:', wsreq.header.reqSeq, url, data);
+ }
const c = (buffers) => { |
robnagler
changed the title
Add sr_trace similar to pkdc
Add SIREPO.traceWS and better logging of ws messages
Sep 26, 2023
robnagler
pushed a commit
that referenced
this issue
Sep 26, 2023
Fix #6351 brilliance.py.jinja incorrect srwpy import
This was referenced Sep 26, 2023
This was referenced Oct 7, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@e-carlin writes:
Add pkdc like feature called sr_trace or similar to sirepo.js. In the client, you can expand the object as opposed to cluttering a terminal window with all messages between client and server, which are often quite large. sr_trace could get the control regex from pkdebug. We could also set it dynamically in production from the js console.
The text was updated successfully, but these errors were encountered: