webpack-log
A common logging module for the Webpack ecosystem
Last updated 7 years ago by shellscape .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install webpack-log 
SYNC missed versions from official npm registry.
webpack-log

tests cover size libera manifesto

webpack-log

A logger for the Webpack ecosystem.

Please consider donating if you find this project useful.

Requirements

This module requires an LTS Node version (v8.0.0+).

Install

Using npm:

npm install webpack-log --save-dev

Usage

Create a new logger and use it to log something wild:

const getLogger = require('webpack-log');
const log = getLogger({ name: 'webpack-batman' });

log.info('Jingle Bells, Batman Smells');
log.warn('Robin laid an egg');
log.error('The Batmobile lost a wheel');
log.debug('And the Joker got away');

And there will appear magic in your console:

console magic

Options

level

Type: String
Default: info

Specifies the level the logger should use. A logger will not produce output for any log level beneath the specified level. Valid level names, and their order are:

[
  'trace',
  'debug',
  'info',
  'warn',
  'error',
  'silent'
]

For example, If a level was passed as { level: 'warn'} then only calls to warn and error will be displayed in the terminal.

name

Type: String
Default: <webpack-log>

Specifies the name of the logger to create. This value will be part of the log output prefix.

timestamp

Type: Boolean
Default: false

If true, the logger will display a timestamp for log output, preceding all other data

unique

Type: Boolean
Default: true

If false, the logger will use cached versions of a log with the same name. Due to the nature of the webpack ecosystem and multiple plugin/loader use in the same process, loggers are created as unique instances by default.

Meta

CONTRIBUTING

LICENSE (Mozilla Public License)

Current Tags

  • 3.0.2                                ...           latest (4 years ago)

11 Versions

  • 3.0.2                                ...           4 years ago
  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.0                                ...           6 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.2                                ...           7 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (9)

Copyright 2013 - present © cnpmjs.org | Home |