From e07ad47e6a0b28b8363246e52eea13b86efda4d6 Mon Sep 17 00:00:00 2001 From: dpyzo0o Date: Mon, 30 Dec 2019 15:06:54 +0800 Subject: [PATCH] chore: tweak --- src/utils/log.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/utils/log.ts b/src/utils/log.ts index eade6bd..208071a 100644 --- a/src/utils/log.ts +++ b/src/utils/log.ts @@ -5,19 +5,28 @@ const isDev = process.env.NODE_ENV === 'development'; export default { info(...args: any[]) { - if (!log || isDev) { + if (isDev) { + return console.info(...args); + } + if (!log) { return; } log.info(...args); }, warn(...args: any[]) { - if (!log || isDev) { + if (isDev) { + return console.warn(...args); + } + if (!log) { return; } log.warn(...args); }, error(...args: any[]) { - if (!log || isDev) { + if (isDev) { + return console.error(...args); + } + if (!log) { return; } log.error(...args);