feat: 🔊 Logger update

This commit is contained in:
DitFranXX
2021-05-26 13:07:33 +09:00
parent a8759b3a4e
commit 860e2c8c7b
3 changed files with 35 additions and 6 deletions
+5 -4
View File
@@ -3,6 +3,9 @@ import { playableMusic } from "./handlers/MusicList"
import { getPlayer, check, regist, savePlayer } from "./handlers/profiles";
import { updatePlayerInfo } from "./handlers/webui";
import { isAsphyxiaDebugMode, isRequiredCoreVersion } from "./utils";
import Logger from "./utils/logger";
const logger = new Logger("main")
export function register() {
if(!isRequiredCoreVersion(1, 20)) {
@@ -65,9 +68,7 @@ export function register() {
R.Unhandled(async (info, data, send) => {
if (["eventlog"].includes(info.module)) return;
console.error(`Received Unhandled Response on ${info.method} by ${info.model}/${info.module}`)
if (isAsphyxiaDebugMode()){
console.error(`Received Request: ${JSON.stringify(data, null, 4)}`)
}
logger.error(`Received Unhandled Response on ${info.method} by ${info.model}/${info.module}`)
logger.debugError(`Received Request: ${JSON.stringify(data, null, 4)}`)
})
}