日志控制

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
@@ -6,6 +6,7 @@
import { DataId, DataManager } from "../data/DataManager";
import { GlobalData } from "../data/GlobalData";
import { ConfigManager } from "../manager/ConfigManager";
import { logger } from "db://assets/Scripts/Main/Common/Logger";
export interface AIConfig {
/** API密钥 */
@@ -60,7 +61,7 @@ export class ApiConfig {
).getTimeout(), // 30秒
};
//console.warn(this.config.apiKey);
//logger.warn(this.config.apiKey);
}
/**
@@ -97,7 +98,7 @@ export class ApiConfig {
if (temperature >= 0 && temperature <= 2) {
this.config.temperature = temperature;
} else {
console.warn("Temperature should be between 0 and 2");
logger.warn("Temperature should be between 0 and 2");
}
}
@@ -110,11 +111,11 @@ export class ApiConfig {
*/
public validateConfig(): boolean {
if (!this.config.apiKey || this.config.apiKey.trim() === "") {
console.error("API key is missing");
logger.error("API key is missing");
return false;
}
if (!this.config.model || this.config.model.trim() === "") {
console.error("Model name is missing");
logger.error("Model name is missing");
return false;
}
return true;