日志控制
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user