增加时间输出

在日志中加入时间输出
This commit is contained in:
lupohan44 2019-10-06 13:00:27 +08:00 committed by GitHub
parent 100c531b13
commit 14c47ca5a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,8 +9,9 @@ MCSERVER.log = function () {
}
MCSERVER.infoLog = (info, value, colors = false) => {
var date = new Date();
let infoStr = colors ? info : info.green;
console.log('[ ' + infoStr + ' ] ' + (value + '').white);
console.log('[ '+date.getFullYear()+'-'+date.getMonth()+1+'-'+date.getDate()+' '+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds()+' ] [ ' + infoStr + ' ] ' + (value + '').white);
}
//error 报告器
@ -29,4 +30,4 @@ MCSERVER.warning = (title, msg = null) => {
MCSERVER.infoLog('WARN'.yellow, msg.white);
}
}
}