GithubHelp home page GithubHelp logo

anthrax3 / webpack-log Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webpack-contrib/webpack-log

0.0 2.0 0.0 56 KB

A common logging module for the Webpack ecosystem

License: MIT License

JavaScript 100.00%

webpack-log's Introduction

npm node deps tests coverage chat

webpack-log

A common logging module for the Webpack ecosystem. webpack-log leverages loglevelnext.

Getting Started

First thing's first, install the module:

npm install webpack-log --save

Note: We do not recommend installing this module globally.

Requirements

webpack-log requires Node v6 or higher.

Usage

const weblog = require('webpack-log');
const log = weblog({ name: 'wds' }) // webpack-dev-server

log.info('Server Starting');

The code above will produce:

output

Options

The default export (function) will return a logger, given an options Object. The following is a property reference for the Object.

Note: the logger returned is unique by default, due to the nature of the webpack ecosystem. Please reference the unique option below for disabling this feature and to force caching.

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. Available levels and order are:

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

Note: The level names shown above correspond to the available logging methods, with the notable exception of the silent level.

name

Required
Type: String
Default: '<unknown>'

Specifies the name of the log to create. This property is required, and used to differentiate between loggers when webpack-log is used in multiple projects executing in the same process space.

timestamp

Type: Boolean
Default: false

If true, instructs the logger to display a timestamp for log output, preceding all other data.

unique

Type: Boolean
Default: true

If false, instructs the logger to used 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 space, loggers are created as unique instances by default. By passing false for this property, the module is instructed to cache the requested logger.

Contributing

We welcome your contributions! Please have a read of CONTRIBUTING.md for more information on how to get involved.

License

webpack-log's People

Contributors

shellscape avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.