mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-09-22 22:27:56 +03:00
feat: 🔊 Logger update
This commit is contained in:
@@ -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)}`)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user