mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-12-09 07:30:04 +08:00
23 lines
624 B
JavaScript
23 lines
624 B
JavaScript
//log 输出标准
|
|
|
|
MCSERVER.log = function () {
|
|
let str = "";
|
|
for (let i = 0; i < arguments.length; i++) {
|
|
str += arguments[i] + ' ';
|
|
}
|
|
MCSERVER.infoLog('INFO', str);
|
|
}
|
|
|
|
MCSERVER.infoLog = (info, value, colors = false) => {
|
|
let infoStr = colors ? info : info.green;
|
|
console.log('[ ' + infoStr + ' ] ' + (value + "").white);
|
|
}
|
|
|
|
//error 报告器
|
|
MCSERVER.error = (msg, err) => {
|
|
let header = 'ERROR';
|
|
MCSERVER.infoLog(header.red, '\n--------Error-------\n', true);
|
|
MCSERVER.infoLog(header.red, msg.yellow, true);
|
|
console.log(err);
|
|
console.log("--------Error-------\n");
|
|
} |