Standard way to initialize a logging object.


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + gzip package size for @rmarscher/log in KB



Returns a log object. Outputs json logs. This is intended to be combined with the @rmarscher/globals and @rmarscher/config packages to add a global log object so writing to the log is as simple as log.info( 'my message' );

The object that is returned is an instance of a bunyan log. You'll want to have npm i -g bunyan and pipe the node process output to bunyan to convert json to a more human readable format.

You can create child loggers from this log to set default vars on all of the child logs which can be pretty useful for adding a request id or setting the type of data being logged for real-time processing of a unified logging layer.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.