change all console logs to log4js
This commit is contained in:
parent
52aaef0515
commit
0927e8287c
1 changed files with 6 additions and 3 deletions
|
|
@ -16,9 +16,12 @@ const makeLogFolder = () => {
|
|||
};
|
||||
|
||||
const makeLogger = () => {
|
||||
const oldLog = global.console.log;
|
||||
global.console.log = (data) => {
|
||||
oldLog(`Unexpected use of console.log. Use the log4js logger instead. ${data}`);
|
||||
global.console.log =
|
||||
global.console.info =
|
||||
global.console.warn =
|
||||
global.console.error =
|
||||
global.console.debug = (...data: any[]) => {
|
||||
console.info((data.length >= 1 ? data.shift() : ''), ...data);
|
||||
};
|
||||
makeLogFolder();
|
||||
log4js.configure({
|
||||
|
|
|
|||
Loading…
Reference in a new issue