# webpack-log

> A logger for the Webpack ecosystem

Latest version **3.0.2** (published 2021-03-11) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install webpack-log
pnpm add webpack-log
yarn add webpack-log
bun add webpack-log
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2021-03-11 |
| First published | 2017-12-18 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | separate (@types/webpack-log) |
| Module format | CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 3 |
| Unpacked size | 22.6 KB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 18 |
| Author | shellscape |
| Maintainers | shellscape |
| Keywords | log, logger, logging, console, terminal, webpack |

## Links

- npm: https://www.npmjs.com/package/webpack-log
- Repository: https://github.com/shellscape/webpack-log
- Issues: https://github.com/shellscape/webpack-log/issues
- npm.io page: https://npm.io/package/webpack-log

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [nanoid](https://npm.io/package/nanoid.md) ^2.0.3
- [loglevelnext](https://npm.io/package/loglevelnext.md) ^3.0.1

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 3.0.2 (latest) — 2021-03-11
- 3.0.1 — 2019-08-01
- 3.0.0 — 2019-08-01
- 2.0.0 — 2018-08-23
- 1.2.0 — 2018-04-05
- 1.1.2 — 2018-02-09
- 1.1.1 — 2018-01-07
- 1.1.0 — 2017-12-22
- 1.0.2 — 2017-12-19
- 1.0.1 — 2017-12-18
- 1.0.0 — 2017-12-18

## 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

<div align="center">
	<img width="180" src="https://raw.githubusercontent.com/shellscape/webpack-log/master/assets/log.svg?sanitize=true" alt="webpack-log"><br/><br/>
</div>

[![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.

<a href="https://www.patreon.com/shellscape">
  <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
</a>

_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:

<div align="center">
	<img width="369" src="assets/demo.png" alt="console magic"><br/><br/>
</div>

## Options

### `level`
Type: `String`<br>
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`<br>
Default: `<webpack-log>`

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

### `timestamp`
Type: `Boolean`<br>
Default: `false`

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

### `unique`
Type: `Boolean`<br>
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)

---
_Source: https://npm.io/package/webpack-log · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
