From 246ef8df5ef00f01f67fb658323b8d709315a546 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Mon, 3 Dec 2018 06:01:59 +0800 Subject: [PATCH] chore: falling-off performance log. (via --performance to see) --- packages/@vuepress/core/lib/build.js | 2 +- packages/@vuepress/core/lib/webpack/DevLogPlugin.js | 2 +- packages/@vuepress/shared-utils/lib/logger.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@vuepress/core/lib/build.js b/packages/@vuepress/core/lib/build.js index 0b96ff0fe3..a4b200e3f1 100644 --- a/packages/@vuepress/core/lib/build.js +++ b/packages/@vuepress/core/lib/build.js @@ -83,7 +83,7 @@ module.exports = async function build (sourceDir, cliOptions = {}) { const relativeDir = path.relative(cwd, outDir) logger.success(`Generated static files in ${chalk.cyan(relativeDir)}.`) const { duration } = performance.stop() - logger.debug(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress build')}.`) + logger.developer(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress build')}.`) console.log() // --- helpers --- diff --git a/packages/@vuepress/core/lib/webpack/DevLogPlugin.js b/packages/@vuepress/core/lib/webpack/DevLogPlugin.js index 2bf57444bf..15a610d2a6 100644 --- a/packages/@vuepress/core/lib/webpack/DevLogPlugin.js +++ b/packages/@vuepress/core/lib/webpack/DevLogPlugin.js @@ -37,7 +37,7 @@ module.exports = class DevLogPlugin { isFirst = false console.log(`${chalk.gray('>')} VuePress dev server listening at ${chalk.cyan(displayUrl)}`) const { duration } = performance.stop() - logger.debug(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress dev')} for the first time.`) + logger.developer(`It took a total of ${chalk.cyan(`${duration}ms`)} to run the ${chalk.cyan('vuepress dev')} for the first time.`) } }) compiler.hooks.invalid.tap('vuepress-log', clearScreen) diff --git a/packages/@vuepress/shared-utils/lib/logger.js b/packages/@vuepress/shared-utils/lib/logger.js index 941cccee16..aa3adb434d 100644 --- a/packages/@vuepress/shared-utils/lib/logger.js +++ b/packages/@vuepress/shared-utils/lib/logger.js @@ -88,7 +88,7 @@ class Logger { } developer (...args) { - if (process.env.VUEPRESS_ENV !== 'developer') { + if (process.env.VUEPRESS_ENV !== 'developer' || process.argv.includes('--developer')) { return } this.status('cyan', 'developer', ...args)