mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-27 06:59:54 +08:00
修改 时间输出颜色与格式
This commit is contained in:
parent
7d1b3a9bc3
commit
387c2e21fe
14
core/log.js
14
core/log.js
@ -9,9 +9,19 @@ MCSERVER.log = function () {
|
||||
}
|
||||
|
||||
MCSERVER.infoLog = (info, value, colors = false) => {
|
||||
var date = new Date();
|
||||
let date = new Date();
|
||||
let infoStr = colors ? info : info.green;
|
||||
console.log('[ '+(date.getFullYear()+'-'+date.getMonth()+1+'-'+date.getDate()).green+' '+(date.getHours()+':'+date.getMinutes()+':'+date.getSeconds()).blue+' ] [ ' + infoStr + ' ] ' + (value + '').white);
|
||||
//时间格式
|
||||
let timeStr = [
|
||||
date.getFullYear(),
|
||||
'-',
|
||||
date.getMonth() + 1,
|
||||
'-',
|
||||
date.getDate(),
|
||||
' ',
|
||||
date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(),
|
||||
].join('');
|
||||
console.log('[', timeStr.green, '] [', infoStr, ']', (value + '').white);
|
||||
}
|
||||
|
||||
//error 报告器
|
||||
|
Loading…
Reference in New Issue
Block a user