export class Logger { /** 总开关:控制所有日志输出 */ public static GLOBAL_ENABLED: boolean = true; /** * 统一日志输出 * @param enable 单独开关(模块级开关) * @param tag 标签(通常是类名或模块名) * @param args 日志内容 */ public static log(enable: boolean, tag: string, ...args: any[]) { if (this.GLOBAL_ENABLED && enable) { console.log(`[${tag}]`, ...args); } } /** * 统一警告输出 * @param enable 单独开关(模块级开关) * @param tag 标签(通常是类名或模块名) * @param args 警告内容 */ public static warn(enable: boolean, tag: string, ...args: any[]) { if (this.GLOBAL_ENABLED && enable) { console.warn(`[${tag}]`, ...args); } } }