From bd948616cd06c05eba780613692ed923bbd68a1d Mon Sep 17 00:00:00 2001 From: sienori Date: Fri, 3 May 2019 17:01:15 +0900 Subject: [PATCH] Fix to call overWriteLogLevel only once --- src/common/log.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/log.js b/src/common/log.js index 1fc26eb..0454caf 100644 --- a/src/common/log.js +++ b/src/common/log.js @@ -1,7 +1,11 @@ import log from "loglevel"; import { getSettings } from "src/settings/settings"; +let isInited = false; export const overWriteLogLevel = () => { + if (isInited) return; + isInited = true; + const originalFactory = log.methodFactory; log.methodFactory = (methodName, logLevel, loggerName) => { const rawMethod = originalFactory(methodName, logLevel, loggerName);