Simple logger for nodejs
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

fary-log

A simple logger for nodejs.

NPM version build status

Install

npm i fary-log

Usage

const log = require('fary-log')
// import log = require('fary-log') // for ts

const logger = log('namespace')

logger.log('log message')
logger.info('some', 'thing')
logger.warn('print some object:', { a: 1, b: 2})
logger.error('Error messages.')

output:

[LOG] namespace - log message
[INFO] namespace - some thing
[WARN] namespace - print some object: { a: 1, b: 2 }
[ERROR] namespace - Error messages.

with colors in the terminal.