-
Notifications
You must be signed in to change notification settings - Fork 45
Conversation
Thanks for the improvements, LGTM Note that I was persuaded in #2 not to enable the exception and error hooks and the signal handler by default. So the |
... what? That honestly renders this tool unusable a lot of the time IMO. Is there no other way to enable it? |
@Fishrock123 modules that when required auto-hook themselves into the system, without the control of the user, are horrid. Can you please explain:
Specifically, why
is "unusable", and
by implication is useable. unusable is a strong word for having to type a half-dozen more characters! Btw, my suggested usage was
to enable the default hooks, and
for customization. @rnchamberlain had trouble implementing that in C++. I'm not sure if that is an inherent limitation of the addon API or not, but I also don't see why the nodereport package.main has to be C++, why not have a half-dozen line js wrapper that exports a function? |
Ah, I see, you hope to use it like:
Fair enough, except that usage breaks this usage:
Where absolutely no hidden side effects (like changing the behaviour of the node process on uncaught exceptions) is desired I suggest the behaviours be distinguished via require path, either:
or
or both. |
I definitely would like the option for people to be able to enable without code change, along with default behavior. Also agree that for a normal require in code we don't want the auto-hook. Is it possible to have it be: require('nodereport') for the case without auto-hook and required('nodereport/attach') or node -r nodereport/attach for the hook case. It would be nice to have the default expected module behaviour for a module without having to know you need to do something special while at the same time giving the user a mechanism to full enable when they know they want to. |
I expect to have those "side-effects" with a module like this... 😐 |
Also yes, I want to never directly |
So right now you can do:
and all the functionality is there. But setting the env vars is nasty. For the sys admin folks I'd prefer this worked out-of-the-box, simply, without any user code change. To accommodate Sam's use case as well (which is perfectly valid - a more advanced user wanting to code to .triggerReport() without the side effects) I think we need something like I have not yet worked out how to implement that - i.e extra parameters on the module initialize(). For the purposes of landing this PR maybe we should remove this line for the time being, or alternatively add the nasty env vars line above it : |
Yes, @Fishrock123 I suggest you modify the README to reflect how it actually works for now so this can land, and discussion of how it could work move to #25 |
Better code blocks, clarity, markdown formatting. PR-URL: #23
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Better code blocks, clarity, markdown formatting. PR-URL: #23 Reviewed-By: Richard Chamberlain <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
Landed as 9b80f24 |
Better code blocks, clarity, markdown formatting.
R=@rnchamberlain