debugalot
v1.0.1
Published
Quick and dirty util for hunting bugs, especially lifecycle issues
Downloads
16
Readme
debugalot
Quick and dirty util for hunting bugs, especially lifecycle issues.
npm install debugalotNot for production apps, just for local debugging.
Usage
const debugalot = require('debugalot')
class Resource {
constructor () {
this.debug = debugalot()
}
thing () {
this.debug.log({ ran: 'thing' })
}
destroy () {
this.debug.destroy()
}
}
const a = new Resource()
a.thing()
// assume bug that makes destroy not being call
// 5s later it prints
/*
debugalot triggered for default
stack at creation:
Error
at debugalot (/Users/maf/dev/node_modules/debugalot/index.js:11:17)
at debugalot (/Users/maf/dev/node_modules/debugalot/index.js:9:40)
at new Resource (/Users/maf/dev/node_modules/debugalot/example.js:5:18)
at Object.<anonymous> (/Users/maf/dev/node_modules/debugalot/example.js:17:11)
at Module._compile (node:internal/modules/cjs/loader:1565:14)
at Object..js (node:internal/modules/cjs/loader:1708:10)
at Module.load (node:internal/modules/cjs/loader:1318:32)
at Function._load (node:internal/modules/cjs/loader:1128:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
logs:
{ ran: 'thing' }
/*License
Apache-2.0
