From 11168a45b4b15c816cf32aa1730d1ca57daad93f Mon Sep 17 00:00:00 2001 From: panwenshuang Date: Thu, 1 Jul 2021 16:49:13 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20logger=20=E4=BF=A1=E6=81=AF=E5=89=8D?= =?UTF-8?q?=E7=BC=80=E5=90=8D=E7=A7=B0=E7=94=B1=20options.app=20=E6=8C=87?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/logger.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/logger.js b/lib/logger.js index ad3347b..9c737ec 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -30,14 +30,14 @@ module.exports = function (prefix) { return; } var content = Array.prototype.slice.call(arguments, 0).join(''); - options.logInstance(options).notice('[yog-ral] ' + prefix + content); + options.logInstance(options).notice(`[${options.app}] ` + prefix + content); }, warning: function (msg) { if (options.disable) { return; } var content = Array.prototype.slice.call(arguments, 0).join(''); - options.logInstance(options).warning('[yog-ral] ' + prefix + content); + options.logInstance(options).warning(`[${options.app}] ` + prefix + content); }, fatal: function (msg) { @@ -45,7 +45,7 @@ module.exports = function (prefix) { return; } var content = Array.prototype.slice.call(arguments, 0).join(''); - options.logInstance(options).fatal('[yog-ral] ' + prefix + content); + options.logInstance(options).fatal(`[${options.app}] ` + prefix + content); }, trace: function () { @@ -53,7 +53,7 @@ module.exports = function (prefix) { return; } var content = Array.prototype.slice.call(arguments, 0).join(''); - options.logInstance(options).trace('[yog-ral] ' + prefix + content); + options.logInstance(options).trace(`[${options.app}] ` + prefix + content); }, debug: function (msg) { @@ -61,7 +61,7 @@ module.exports = function (prefix) { return; } var content = Array.prototype.slice.call(arguments, 0).join(''); - options.logInstance(options).debug('[yog-ral] ' + prefix + content); + options.logInstance(options).debug(`[${options.app}] ` + prefix + content); } }; };