From 0d4c80784f56ef368cbdbed28bed4335106deab8 Mon Sep 17 00:00:00 2001 From: sean Date: Sat, 14 Jun 2025 13:39:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Logger=E7=B1=BB=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA=EF=BC=8C=E5=B0=86?= =?UTF-8?q?console.log=E6=9B=BF=E6=8D=A2=E4=B8=BAconsole.error=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E7=A1=AE=E4=BF=9D=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E6=AD=A3=E7=A1=AE=E8=BE=93=E5=87=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/utils/logger.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/utils/logger.js b/src/lib/utils/logger.js index 632aa85..cdf491a 100644 --- a/src/lib/utils/logger.js +++ b/src/lib/utils/logger.js @@ -15,7 +15,7 @@ class Logger { */ info (message, ...args) { if (this.silent) return - console.log(chalk.blue('ℹ'), message, ...args) + console.error(chalk.blue('ℹ'), message, ...args) } /** @@ -23,7 +23,7 @@ class Logger { */ success (message, ...args) { if (this.silent) return - console.log(chalk.green('✅'), message, ...args) + console.error(chalk.green('✅'), message, ...args) } /** @@ -31,7 +31,7 @@ class Logger { */ warn (message, ...args) { if (this.silent) return - console.log(chalk.yellow('⚠️'), chalk.yellow(message), ...args) + console.error(chalk.yellow('⚠️'), chalk.yellow(message), ...args) } /** @@ -47,7 +47,7 @@ class Logger { */ debug (message, ...args) { if (this.silent || !process.env.DEBUG) return - console.log(chalk.gray('🐛'), chalk.gray(message), ...args) + console.error(chalk.gray('🐛'), chalk.gray(message), ...args) } /** @@ -55,7 +55,7 @@ class Logger { */ step (message, ...args) { if (this.silent) return - console.log(chalk.cyan('▶️'), message, ...args) + console.error(chalk.cyan('▶️'), message, ...args) } /** @@ -63,7 +63,7 @@ class Logger { */ log (message, ...args) { if (this.silent) return - console.log(message, ...args) + console.error(message, ...args) } /** @@ -71,7 +71,7 @@ class Logger { */ newLine () { if (this.silent) return - console.log('') + console.error('') } /** @@ -79,7 +79,7 @@ class Logger { */ separator (char = '=', length = 80) { if (this.silent) return - console.log(chalk.gray(char.repeat(length))) + console.error(chalk.gray(char.repeat(length))) } }