Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shellscape/webpack-log
A logger for the Webpack ecosystem
https://github.com/shellscape/webpack-log
console log logger logging terminal webpack
Last synced: 8 days ago
JSON representation
A logger for the Webpack ecosystem
- Host: GitHub
- URL: https://github.com/shellscape/webpack-log
- Owner: shellscape
- License: mpl-2.0
- Created: 2019-08-01T14:04:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-11T15:41:02.000Z (almost 4 years ago)
- Last Synced: 2024-12-26T07:35:53.509Z (20 days ago)
- Topics: console, log, logger, logging, terminal, webpack
- Language: JavaScript
- Homepage:
- Size: 488 KB
- Stars: 18
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/funding.yml
- License: LICENSE
Awesome Lists containing this project
README
[tests]: https://img.shields.io/circleci/project/github/shellscape/webpack-log.svg
[tests-url]: https://circleci.com/gh/shellscape/webpack-log[cover]: https://codecov.io/gh/shellscape/webpack-log/branch/master/graph/badge.svg
[cover-url]: https://codecov.io/gh/shellscape/webpack-log[size]: https://packagephobia.now.sh/badge?p=webpack-log
[size-url]: https://packagephobia.now.sh/result?p=webpack-log
[![tests][tests]][tests-url]
[![cover][cover]][cover-url]
[![size][size]][size-url]
[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)# webpack-log
A logger for the Webpack ecosystem.
_Please consider donating if you find this project useful._
## Requirements
This module requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+).
## Install
Using npm:
```console
npm install webpack-log --save-dev
```## Usage
Create a new logger and use it to log something wild:
```js
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:
## 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:```js
[
'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: ``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](./.github/CONTRIBUTING.md)
[LICENSE (Mozilla Public License)](./LICENSE)