GithubHelp home page GithubHelp logo

webpack-contrib / webpack-log Goto Github PK

View Code? Open in Web Editor NEW
38.0 11.0 14.0 645 KB

[DEPRECATED] Please use logger API https://github.com/webpack/webpack/pull/9436

License: MIT License

JavaScript 100.00%
webpack logging logger log

webpack-log's Introduction

[DEPRECATED] Plese use logger api webpack/webpack#9436

npm node deps test coverage chat

webpack Log

A common logging module for the webpack ecosystem

Install

npm i -D webpack-log

⚠️ We do not recommend installing this module globally

Usage

const log = require('webpack-log');
const logger = log({ name: 'wds' });

logger.info('Server Starting');

output

ℹ️ 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

Options

Name Type Default Description
name {String} ''<unknown>' Log Name (Required)
level {String} 'info' Log Level
unique {Boolean} true Log Uniqueness
timestamp {Boolean} false Log Timestamps

name

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

const logger = log({ name: 'wds' });

level

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:

['info', 'warn', 'error', 'trace', 'debug', 'silent'];
const logger = log({ level: 'error' });

logger.error(err);

ℹ️ The level names shown above correspond to the available logging methods, with the notable exception of the silent level

unique

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

const logger = log({ unique: true });

timestamp

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

const logger = log({ timestamp: true });

webpack-log's People

Contributors

doowb avatar evilebottnawi avatar hiroppy avatar michael-ciniawsky avatar shellscape avatar sokra avatar wuct avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webpack-log's Issues

npm ERR! 404 Not Found: webpack-log@latest using verdaccio

today I'm not able to install webpack-log using:

npm i -D webpack-log

npm ERR! code E404
npm ERR! 404 Not Found: webpack-log@latest

I don't have any problem with other packages. Find this problem installing webpack-dev-server.

I'm using verdaccio I needed to execute:

npm set registry https://registry.npmjs.org/ && npm i -D webpack-dev-server && npm set registry http://localregisty:4873/

Issue with name decoration (unicode) on Arch Linux

  • Operating System: Arch Linux, kernel 4.16.7, running Cinnamon 3.8.2, using ttf-inconsolata for monospace
  • Node Version: 8.11.1
  • NPM Version: 6.0.1
  • webpack Version: 4.8.3
  • webpack-serve Version: 1.0.2
  • This is a bug
  • This is a feature request
  • This is a modification request

Code

template: `{{level}} ${chalk.gray('「{{name}}」')}: `

Expected Behavior

For it to look pretty! ❤️

Actual Behavior

Looks broken 😢

screenshot from 2018-05-15 16-00-39

For Bugs; How can we reproduce the behavior?

Run webpack-serve inside a default terminal on Linux (same error in GNOME Terminal 3.28.1, for example)


Perhaps a different symbol (or none at all) is better for cross platform?

LICENSE Not Retained From loglevelnext

  • Operating System: n/a
  • Node Version: n/a
  • NPM Version: n/a
  • webpack Version: n/a
  • webpack-dev-server Version: 2.0.0
  • This is a bug
  • This is a feature request
  • This is a modification request

Code

n/a

Expected Behavior

I would expect the LICENSE from loglevelnext to be included in this project.

Actual Behavior

No LICENSE attribution exists. This commit copied loglevelnext into the project, rather than using it as a dependency. The LICENSE for loglevelnext states:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

At present, this project is in violation of that clause.

For Bugs; How can we reproduce the behavior?

n/a

For Features; What is the motivation and/or use-case for the feature?

n/a

Issue with name decoration on Linux

Narrowed it down to:

template: `{{level}} ${chalk.gray('「{{name}}」')}: `

The square-thingy that's being used there appears like this when using webpack-serve:

screenshot from 2018-05-15 16-00-39

Perhaps a different symbol (or none at all) is better for cross platform?

Write to STDERR, not STDOUT (for webpack --json > stats.json)

  • Operating System: macOS 10.13.6
  • Node Version: v8.7.0
  • NPM Version: 5.4.2
  • webpack Version: 4.12.0
  • webpack-dev-server Version: N/A
  • This is a bug
  • This is a feature request
  • This is a modification request

Code

$ node -e '"log,debug,info,warn,error".split(",").forEach(level =>  require("webpack-log")({ name: "test" })[level](level))' > /dev/null
⚠ 「test」: warn
✖ 「test」: error

Expected Behavior

Always write to STDERR, or at least configurable from caller.

Actual Behavior

Only warn and error are written to STDERR, others are written to STDOUT.

For Features; What is the motivation and/or use-case for the feature?

webpack --json > stats.json will cause corrupted JSON if log written to STDOUT.
s-panferov/awesome-typescript-loader#461

⚠️ npm access

npm view webpack-log
[email protected] | MIT | deps: 4 | versions: 7
A common logging module for the Webpack ecosystem
http://github.com/webpack-contrib/webpack-log

dist
.tarball: https://registry.npmjs.org/webpack-log/-/webpack-log-1.2.0.tgz
.shasum: a4b34cda6b22b518dbb0ab32e567962d5c72a43d
.integrity: sha512-U9AnICnu50HXtiqiDxuli5gLB5PGBo7VvcHx36jRZHwK4vzOYLbImqTEekokTEKHA==
.unpackedSize: 7.6 kB

dependencies:
chalk: ^2.1.0        log-symbols: ^2.1.0  loglevelnext: ^1.0.1 uuid: ^3.1.0

maintainers:
- bebraw <[email protected]>
- d3viant0ne <[email protected]>
- shellscape <[email protected]>

dist-tags:
latest: 1.2.0

published 4 months ago by shellscape <[email protected]>

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.