Memorandum
Simple logging utility with all the bells and whistles.
Features
- color output (if output supports it) using ANSI codes
- timestamp (with timezone support, defaults to local)
- prettyprint JSON objects
- error traces
Install
npm install memorandum
Usage
var log = ; log;log;log;log;log;log;
Constructor
When creating the log you can pass an optional module id
to the constructor. This will show up in the log.
var log = "my module"; log;// 2014-09-02 17:22:00 my module info: log message
Methods
These are the methods available to log messages.
- info: display information messages
- warn: display warning messages
- error: display errors (with trace)
- debug: display debug messages or objects (as JSON)
Settings
Settings can be changed globally. They allow you to tweak some parts of the log output.
var memorandum = ; // default settings:memorandumsettingstimestamptimezone = null; // MomentJS timezone (null = local)memorandumsettingstimestampformat = "YYYY-MM-DD HH:mm:ss.SSS"; // MomentJS format