{"id":20790,"library":"webpack-log","title":"webpack-log","description":"A logger for the Webpack ecosystem, currently at version 3.0.2. This library provides a simple logging API with configurable log levels (trace, debug, info, warn, error, silent), support for timestamps, and unique logger instances to avoid collisions in the Webpack multi-plugin environment. Version 3.0.0 was a complete rewrite, replacing ansi-colors with chalk and uuid with nanoid. It requires Node 8.0.0+. The project is actively maintained with a focus on Webpack plugin and loader development.","status":"active","version":"3.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/shellscape/webpack-log","tags":["javascript","log","logger","logging","console","terminal","webpack"],"install":[{"cmd":"npm install webpack-log","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-log","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-log","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core logging functionality","package":"loglevelnext","optional":false},{"reason":"colored console output (replaced ansi-colors in v3)","package":"chalk","optional":false},{"reason":"unique logger ID generation (replaced uuid in v3)","package":"nanoid","optional":false}],"imports":[{"note":"The package exports a single function as default. In ESM, use default import. In CJS, require returns the function directly.","wrong":"const { getLogger } = require('webpack-log')","symbol":"getLogger","correct":"import getLogger from 'webpack-log'"},{"note":"The package does not export TypeScript type declarations. You must define your own interface for options. Use the type shown for type safety.","wrong":"import { LoggerOptions } from 'webpack-log'","symbol":"LoggerOptions","correct":"type LoggerOptions = { name?: string; level?: string; timestamp?: boolean; unique?: boolean }"},{"note":"In CommonJS, the default export is the function itself, not an object with a getLogger property. Destructuring will yield undefined.","wrong":"const { getLogger } = require('webpack-log')","symbol":"getLogger (CJS)","correct":"const getLogger = require('webpack-log')"}],"quickstart":{"code":"const getLogger = require('webpack-log');\nconst log = getLogger({ name: 'my-plugin', level: 'info', timestamp: true });\nlog.info('Logger initialized successfully');\nlog.warn('This is a warning');\nlog.error('An error occurred');\nlog.debug('This debug message will not appear because level is info');","lang":"javascript","description":"Creates a logger instance with name 'my-plugin', level 'info', and timestamps enabled, then logs messages at various levels."},"warnings":[{"fix":"Remove the `colors` option from logger configuration. If you need custom colors, fork the package or use `chalk` manually.","message":"The `colors` option for customizing ANSI colors has been removed in v3. Use `chalk` directly or create your own logger.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Access color formatting through `chalk` instead of `log.colors`.","message":"The `colors` property on the logger instance (e.g., `log.colors`) is deprecated in v3.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"In v2 and below, use `unique: true` to avoid sharing loggers. In v3, unique defaults to true, so no change needed.","message":"Loggers with the same `name` are cached by default (unique: true), meaning two calls with the same name return the same instance. To create distinct loggers, set `unique: true` explicitly.","severity":"gotcha","affected_versions":"<3.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change `const { getLogger } = require('webpack-log')` to `const getLogger = require('webpack-log')`.","cause":"Destructuring the required object as `const { getLogger } = require('webpack-log')` instead of direct assignment.","error":"TypeError: getLogger is not a function"},{"fix":"Add `name` to the options: `getLogger({ name: 'my-logger' })`.","cause":"Calling `getLogger()` without a `name` in the options object (required in v3).","error":"Error: You must specify a name for the logger"},{"fix":"Run `npm install webpack-log --save-dev` (or `--save` if not dev dependency).","cause":"Package not installed or wrong package name.","error":"Cannot find module 'webpack-log'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}