yahoo/monitr — pull request #17 by etorrie (2014-06-10 07:11:45+00:00)
Title: Only log BREAK events generated by v8::Debug::DebugBreak()

Primarily, this patch eliminates the frequent `Process received SIGHUP` messages from this module.

The fix ensures that in the `DebugEventListener`, we only consider Debugger events which correspond to the Debug::DebugBreak() command which we call at signal handler time.

Prior to this, the install DebugEventListener would get event callbacks from the v8 Debugger API whenever any event of potential interest to a debugger would occur, e.g. `BeforeCompileScript`, `AfterCompileScript` as seen here:

https://github.com/v8/v8/blob/1735e029d3ee2dbf940c4399d581a730bda59902/include/v8-debug.h#L16

In addition, as a side-effect, I've also added a getter/setter for a `backtrace` property on the `monitr.exports` such that you can enable or disable whether a backtrace is printed.

A demonstration of this is given in the accompanying `monitor_me.js` script.