Fix to call overWriteLogLevel only once
This commit is contained in:
parent
f63fa7fff9
commit
bd948616cd
|
@ -1,7 +1,11 @@
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { getSettings } from "src/settings/settings";
|
import { getSettings } from "src/settings/settings";
|
||||||
|
|
||||||
|
let isInited = false;
|
||||||
export const overWriteLogLevel = () => {
|
export const overWriteLogLevel = () => {
|
||||||
|
if (isInited) return;
|
||||||
|
isInited = true;
|
||||||
|
|
||||||
const originalFactory = log.methodFactory;
|
const originalFactory = log.methodFactory;
|
||||||
log.methodFactory = (methodName, logLevel, loggerName) => {
|
log.methodFactory = (methodName, logLevel, loggerName) => {
|
||||||
const rawMethod = originalFactory(methodName, logLevel, loggerName);
|
const rawMethod = originalFactory(methodName, logLevel, loggerName);
|
||||||
|
|
Loading…
Reference in a new issue