添加 - 危险报告器

This commit is contained in:
suwings 2018-04-15 21:13:15 +08:00
parent 0310a46352
commit bf80bc6d58
2 changed files with 11 additions and 2 deletions

View File

@ -10,7 +10,7 @@ MCSERVER.log = function () {
MCSERVER.infoLog = (info, value, colors = false) => {
let infoStr = colors ? info : info.green;
console.log('[ ' + infoStr + ' ] ' + (value + "").white);
console.log('[ ' + infoStr + ' ] ' + (value + '').white);
}
//error 报告器
@ -20,4 +20,13 @@ MCSERVER.error = (msg, err) => {
MCSERVER.infoLog(header.red, msg.yellow, true);
console.log(err);
console.log("--------Error-------\n");
}
MCSERVER.warning = (title, msg = null) => {
console.log('[Warning] '.yellow + title.white);
if (msg) {
console.log('[Warning] '.yellow + msg.white);
}
}

View File

@ -76,7 +76,7 @@ router.ws('/ws', function (ws, req) {
MCSERVER.log('[ WebSocket MSG ]', ' 未登陆用户尝试发起 Websocket 被拒绝');
counter.plus('notPermssionCounter');
return;
};
}
try {
//在线用户计数器