지금까지 내용 커밋

This commit is contained in:
2026-04-08 12:59:45 +09:00
commit b0dae31cb9
68 changed files with 12083 additions and 0 deletions

38
bot/src/utils/Logger.ts Normal file
View File

@@ -0,0 +1,38 @@
import colors from "colors/safe";
export const Timestamp = () => {
const Now = new Date();
Now.setHours(Now.getHours() + 9);
return Now.toISOString().replace('T', ' ').substring(0, 19).slice(2);
}
type logType = "log" | "info" | "warn" | "error" | "debug" | "ready" | "slash";
const log = (content: string, type: logType) => {
const timestamp = colors.white(`[${Timestamp()}]`);
switch (type) {
case "log":
return console.log(`${colors.gray("[LOG]")} ${timestamp} ${content}`);
case "info":
return console.log(`${colors.cyan("[INFO]")} ${timestamp} ${content}`);
case "warn":
return console.log(`${colors.yellow("[WARN]")} ${timestamp} ${content}`);
case "error":
return console.log(`${colors.red("[ERROR]")} ${timestamp} ${content}`);
case "debug":
return console.log(`${colors.magenta("[DEBUG]")} ${timestamp} ${content}`);
case "ready":
return console.log(`${colors.green("[READY]")} ${timestamp} ${content}`);
default:
throw new TypeError("Logger 타입이 올바르지 않습니다.");
}
};
export const Logger = {
log: (content: string) => log(content, "log"),
warn: (content: string) => log(content, "warn"),
error: (content: string) => log(content, "error"),
debug: (content: string) => log(content, "debug"),
info: (content: string) => log(content, "info"),
ready: (content: string) => log(content, "ready")
}