日志控制

This commit is contained in:
chen wei bo
2025-09-21 20:36:25 +08:00
parent e78f6b937e
commit 93bfe3174f
23 changed files with 91 additions and 81 deletions
+5 -5
View File
@@ -108,7 +108,7 @@ export class ChatModel {
//const roleDetail = ConfigManager.tables.TbGirlsDetail.get(roleId);
if (!girlData) {
console.error(`ChatModel: Role data not found for roleId ${girlId}`);
logger.error(`ChatModel: Role data not found for roleId ${girlId}`);
return null;
}
@@ -124,7 +124,7 @@ export class ChatModel {
return newRoleData;
} catch (error) {
console.error(
logger.error(
`ChatModel: Failed to create role data for ${girlId}:`,
error
);
@@ -208,18 +208,18 @@ export class ChatModel {
public addDialog(isPlayer: boolean, content: string, roleId?: number): void {
const targetRoleId = roleId || this.currentGirlId;
if (!targetRoleId) {
console.warn("ChatModel: Cannot add dialog - no active role");
logger.warn("ChatModel: Cannot add dialog - no active role");
return;
}
if (!content || content.trim() === "") {
console.warn("ChatModel: Cannot add empty dialog content");
logger.warn("ChatModel: Cannot add empty dialog content");
return;
}
const roleData = this.rolesData.get(targetRoleId);
if (!roleData) {
console.warn(`ChatModel: Role data not found for roleId ${targetRoleId}`);
logger.warn(`ChatModel: Role data not found for roleId ${targetRoleId}`);
return;
}