Allow warn and error to bypass the dev-only logging
This commit is contained in:
parent
27c5fccba0
commit
b2c22be84c
1 changed files with 6 additions and 1 deletions
|
|
@ -13,6 +13,11 @@ const augmentedProps = new Set([
|
||||||
`timeStamp`,
|
`timeStamp`,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const happensInProd = new Set([
|
||||||
|
`warn`,
|
||||||
|
`error`,
|
||||||
|
]);
|
||||||
|
|
||||||
function noop() {};
|
function noop() {};
|
||||||
|
|
||||||
/** @type {null | boolean} */
|
/** @type {null | boolean} */
|
||||||
|
|
@ -26,7 +31,7 @@ export const Logger = new Proxy(console, {
|
||||||
inDev = game.modules.get(__ID).flags.inDev;
|
inDev = game.modules.get(__ID).flags.inDev;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!inDev) {
|
if (!inDev && !happensInProd.has(prop)) {
|
||||||
return noop;
|
return noop;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue