MCPcopy Create free account
hub / github.com/webpack/webpack-cli / getLogger

Method getLogger

packages/webpack-cli/src/webpack-cli.ts:597–610  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

595 }
596
597 getLogger(): Logger {
598 // Status icons brand every webpack-cli message (`✔`/`✖`/`⚠`/`ℹ`). They sit
599 // between the `[webpack-cli]` prefix and the unchanged message text, so
600 // tooling that greps the prefix or the message keeps working, and they
601 // collapse to plain glyphs when colors are disabled.
602 return {
603 error: (val) => console.error(`[webpack-cli] ${this.colors.red(`✖ ${util.format(val)}`)}`),
604 warn: (val) => console.warn(`[webpack-cli] ${this.colors.yellow(`⚠ ${val}`)}`),
605 info: (val) => console.info(`[webpack-cli] ${this.colors.cyan(`ℹ ${val}`)}`),
606 success: (val) => console.log(`[webpack-cli] ${this.colors.green(`✔ ${val}`)}`),
607 log: (val) => console.log(`[webpack-cli] ${val}`),
608 raw: (val) => console.log(val),
609 };
610 }
611
612 async getDefaultPackageManager(): Promise<PackageManager | undefined> {
613 const { sync } = await import("cross-spawn");

Callers 1

constructorMethod · 0.95

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected