refactor: 移除调试日志并统一使用日志工具

- 删除多个文件中的 console.log/console.warn/console.error 调试输出
- 将日志输出统一替换为 mLogger 工具,支持调试模式控制
- 清理注释掉的调试代码和空方法体
This commit is contained in:
panw
2026-02-03 16:49:24 +08:00
parent dc746e28da
commit 3a8f015a78
21 changed files with 65 additions and 80 deletions

View File

@@ -5,6 +5,7 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
import { GameEvent } from "../common/config/GameEvent";
import { smc } from "../common/SingletonModuleComp";
import { CardKind } from "../common/config/GameSet";
import { mLogger } from "../common/Logger";
const { ccclass, property } = _decorator;
@@ -12,6 +13,7 @@ const { ccclass, property } = _decorator;
@ccclass('MissionGetsCompComp')
@ecs.register('MissionGetsComp', false)
export class MissionGetsCompComp extends CCComp {
debugMode = false;
get_datas: { [key: number]: { num: number, node: Node, kind?: number } } = {};
get_nodes: Node[] = [];
// 图标图集缓存
@@ -49,7 +51,7 @@ export class MissionGetsCompComp extends CCComp {
}
addGet(uuid: number, iconName?: string, kind?: number) {
console.log("[MissionGetsComp]添加获取到的物品:", uuid, iconName, kind);
mLogger.log(this.debugMode, 'MissionGetsComp', "[MissionGetsComp]添加获取到的物品:", uuid, iconName, kind);
if (this.get_datas[uuid]) {
this.get_datas[uuid].num++;
this.updateNodeNum(this.get_datas[uuid].node, this.get_datas[uuid].num);
@@ -62,7 +64,7 @@ export class MissionGetsCompComp extends CCComp {
var path = "game/gui/get";
var prefab: Prefab = oops.res.get(path, Prefab)!;
if (!prefab) {
console.warn("Prefab not found:", path);
mLogger.log(this.debugMode, 'MissionGetsComp', "Prefab not found:", path);
return;
}
var node = instantiate(prefab);
@@ -129,7 +131,7 @@ export class MissionGetsCompComp extends CCComp {
// 加载图集
resources.load("gui/uicons", SpriteAtlas, (err, atlas) => {
if (err) {
console.error("[MissionGetsComp] Failed to load uicons atlas", err);
mLogger.error(this.debugMode, 'MissionGetsComp', "[MissionGetsComp] Failed to load uicons atlas", err);
return;
}
this.uiconsAtlas = atlas;