mattrobenolt/raven-node — pull request #20 by shtylman (2012-10-04 16:47:10+00:00)
Title: code cleanup and other changes

I am using this library in a number of my projects and wanted to offer some changes which I think give the library a bit more focus and also fix some things. I have outlined some of the changes below and some more plans

* Remove express/connect stuff. I would make a separate module for this. Keep this module simple and focused on just talking to getsentry
* read modules from main module path (this is actually a fix. You can't rely on the `cwd` since apps don't need to be launched from the folder their project is in. Better to use require.main
* pin node-uuid version (be nice to users of your package, don't make their deployments vary depending on what the latest version of a package might be. Any changes could potentially break things and since you test against a specific version, depend on that version).

Plans
* remove NODE_ENV variable use. It is not for you to decide what variables constitute "production" this is a faux convention that was propagated in the early days of node that really has no bearing on usecase.
* cleanup some of the code to be more javascript style and less python like (object access, etc)
* remove global catch all. Again, users can write other modules that do this (book, winston, loggly) and handle it how they want. Better to keep this module simple.
* remove auto recognition of the other env variables. Goes along with explicit better than implicit. Maybe suggest the use of these variables or example patterns but otherwise don't autodetect.

Basically, the my idea is that this module should really do nothing more than help you create messages in the proper format and send them along. More sophisticated logging modules can be built on top of this one which do some of the more "opinionated" things.

I am happy to hop on IRC to chat about why I feel these changes are good :)