https://github.com/dresende/node-memorandum
Simple logging utility with all the bells and whistles
https://github.com/dresende/node-memorandum
Last synced: 3 months ago
JSON representation
Simple logging utility with all the bells and whistles
- Host: GitHub
- URL: https://github.com/dresende/node-memorandum
- Owner: dresende
- License: mit
- Created: 2014-09-02T16:28:13.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-04T10:02:11.000Z (over 10 years ago)
- Last Synced: 2025-06-23T10:51:17.410Z (7 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## Memorandum
[](https://npmjs.org/package/memorandum)
[](https://gemnasium.com/dresende/node-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
```sh
npm install memorandum
```
### Usage
```js
var log = require("memorandum")();
log.info("this is an information message");
log.warn("this is a warning message");
log.error(new TypeError());
log.debug("this is a debug message");
log.debug({ x: 1 });
log.debug({ x: 2 }, "other debug object");
```
### Constructor
When creating the log you can pass an optional `module id` to the constructor. This will show up in the log.
```js
var log = require("memorandum")("my module");
log.info("log message");
// 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.
```js
var memorandum = require("memorandum");
// default settings:
memorandum.settings.timestamp.timezone = null; // MomentJS timezone (null = local)
memorandum.settings.timestamp.format = "YYYY-MM-DD HH:mm:ss.SSS"; // MomentJS format
```