This commit is contained in:
2024-08-10 20:35:02 +08:00
parent 88233c58e3
commit 90f6ed0bc3
50 changed files with 5333 additions and 0 deletions

24
Server/plugs/Logger.ts Normal file
View File

@@ -0,0 +1,24 @@
class _Logger{
constructor(){
}
formatTime(): string{
let date = new Date();
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
}
info(msg: string){
console.log(`[${this.formatTime()}][INFO] ${msg}`);
}
warn(msg: string){
console.log(`[${this.formatTime()}][WARN] ${msg}`);
}
error(msg: string){
console.log(`[${this.formatTime()}][ERROR] ${msg}`);
}
}
let Logger = new _Logger();
export default Logger;