js-visualizer-9000-client icon indicating copy to clipboard operation
js-visualizer-9000-client copied to clipboard

Console Log should be push and pop into call stack

Open PhakornKiong opened this issue 4 years ago • 0 comments

Based on current behaviour, console.log() is visualized using showSnackbar() in the client side.

Currently only user-defined function will get instrumented via Tracer.EnterFunc and Tracer.ExitFunc.

As console.log() is a function call, perhaps we should make visualizing call stack more complete. This can be implemented from server-side or client-side.

However, my opinion skew towards the client-side as this is merely a presentation issue and we do not need to support much function call anyway.

We could simply update this to the supported call expression. The timeout of 500 is picked according to the puase value adopted in the autoPlayEvents() App.js

 playNextEvent = () => {
// other code
  if (type === 'ConsoleLog') {
        this.pushCallStackFrame(type);
        this.showSnackbar('info', message);
        setTimeout(() => {
          this.popCallStackFrame();
        }, 500);
      }
// other code
}

Let me know what you think!

PhakornKiong avatar Feb 24 '21 08:02 PhakornKiong