Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

zog

0.1.2 • Public • Published

zog

A wrapper around the debug module to infer logger namespace from filename, support logging levels, and have support for CommonJS and ES6.

Install

npm i zog

Usage

Infer namespace from filename

// foo/bar.js
 
import {log, info, debug, warn, error} from 'live-log'
 
log('hello')
info('hello')
debug('hello')
warn('hello')
error('hello')

Output

foo/bar hello
foo/bar hello
foo/bar hello
foo/bar WARNING: hello
foo/bar ERROR: hello

Explicit namespace

// foo/index.js
 
const logger = require('live-log')('foo')
 
logger.log('hello')
foo hello

API

default logger Logger info log debug warn error

Convenience

time timeEnd xcolor xc c Debug

Keywords

none

install

npm i zog

Downloadsweekly downloads

72

version

0.1.2

license

SEE LICENSE IN ./docs/license.md

last publish

collaborators

  • avatar