feat: 引入集中式日志工具类并重构调试日志
- 新增 Logger 类提供统一的日志和警告输出,支持全局和模块级开关 - 重构 SkillView、HeroViewComp 和 HeroAtkSystem 中的调试日志方法,改用 Logger 类 - 在 HeroViewComp 中添加调试模式属性便于编辑器配置 - 统一日志格式为 [标签] + 内容,提高日志可读性和维护性
This commit is contained in:
@@ -7,6 +7,7 @@ import { SDataCom } from "./SDataCom";
|
||||
import { Attrs } from "../common/config/HeroAttrs";
|
||||
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
||||
import { DamageQueueHelper } from "../hero/DamageQueueComp";
|
||||
import { Logger } from "../common/Logger";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -24,15 +25,11 @@ export class SkillView extends CCComp {
|
||||
private debugMode: boolean = false;
|
||||
|
||||
private debugLog(...args: any[]): void {
|
||||
if (this.debugMode) {
|
||||
console.log(...args);
|
||||
}
|
||||
Logger.log(this.debugMode, 'SkillView', ...args);
|
||||
}
|
||||
|
||||
private debugWarn(...args: any[]): void {
|
||||
if (this.debugMode) {
|
||||
console.warn(...args);
|
||||
}
|
||||
Logger.warn(this.debugMode, 'SkillView', ...args);
|
||||
}
|
||||
|
||||
anim:Animation=null;
|
||||
|
||||
Reference in New Issue
Block a user