Raynos / dom-delegator

Decorate elements with delegated events
MIT License
57 stars 16 forks source link

Debug option #8

Open gsf opened 10 years ago

gsf commented 10 years ago

If you suspect there might be an issue or bug with an event not getting fired you should go into node_modules/mercury/node_modules/dom-delegator and edit your copy of dom-delegator to add print statements.

The above in https://github.com/Raynos/mercury/blob/master/docs/life-cycles.md#reacting-to-dom-events feels pretty hacky. Could we add a debug option to the Delegator constructor to activate well-placed and informative log statements to aid us in these scenarios?

The debug choice would also have to be made available to DomDelegator in some way -- not sure how best to do that. Maybe it could accept an opts object as well instead of just document.

Raynos commented 10 years ago

I can add debuglog to this module.

I want to implement https://github.com/sam-github/node-debuglog/issues/4#issuecomment-49513667

Then use debuglog in this module.

gsf commented 10 years ago

Good to know about debuglog. I'm guessing it would work as is with envify?

Raynos commented 10 years ago

@gsf more thinking about ?NODE_DEBUG=things in the query string or NODE_DEBUG global.

I don't want to do envify magic or source manipulation