JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 49
  • Score
    100M100P100Q62017F
  • License SEE LICENSE IN ./docs/license.md

Package Exports

  • zog

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (zog) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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