0.0.9 • Published 1 year ago

super-trace v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

quick start

npm install super-trace
import superTrace from 'super-trace';

function a(){
  superTrace.headerLog("started")
  b()
  c()
  e()
}

function b(){
  superTrace.log()
  d()
}

function c(){
  superTrace.log()
  var loop = 3;
  while (loop--) {
    d()
    e()
  }
}

function d(){
  superTrace.log()
}

function e() {
  superTrace.log()
}

a()

superTrace.superLog()

you will get following:

├──┴started::a  path:: at internal/main/run_main_module.js:17:47 => Function.executeUserEntryPoint [as runMain] => Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a
├─────┼started-0::b  path:: Function.executeUserEntryPoint [as runMain] => Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => b
├────────┴started-1::d  path:: Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => b => d
├─────┼started-2::c  path:: Function.executeUserEntryPoint [as runMain] => Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => c
├────────┼started-3::d  path:: Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => c => d
├────────┼started-4::e  path:: Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => c => e
├────────┼started-5::d  path:: Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => c => d
├────────┼started-6::e  path:: Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => c => e
├────────┼started-7::d  path:: Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => c => d
├────────┴started-8::e  path:: Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => c => e
├─────┴started-9::e  path:: Function.executeUserEntryPoint [as runMain] => Function.Module._load => Module.load => Object.Module._extensions..js => Module._compile => Object.<anonymous> => a => e

how to use

just use superTrace.headerLog as a beginning, then superTrace.log as a step setting in functions you interested in.

finally use superTrace.superLog you will see a call-stacks displayed as tree structure

for what

you can use superTrace to decode source code:

123

can not

if the SuperTrace.log was triggered by a settimeout or something similar, then tree can not created. But you can make this superTrace.log as a headerLog, then get the next flows.

if the SuperTrace.log was an orphan, it will be added to the session root as a special child, It's gray when been displayed.

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago