mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-03-11 14:17:32 +08:00
refactor(logging): implement unified Logger system to replace console calls
- Add Logger utility with tagged output and environment-based control - Configure Babel to remove console calls in production builds - Replace all console.* calls across stores, services, and components with Logger - Enable development-only logging with formatted output and component tags - Optimize production builds by eliminating all logging code
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
|
||||
import Logger from '@/utils/Logger';
|
||||
|
||||
const logger = Logger.withTag('API');
|
||||
|
||||
// region: --- Interface Definitions ---
|
||||
export interface DoubanItem {
|
||||
title: string;
|
||||
@@ -215,13 +219,13 @@ export class API {
|
||||
|
||||
// 添加安全检查
|
||||
if (!config || !config.Config.SourceConfig) {
|
||||
console.warn('API response missing SourceConfig:', config);
|
||||
logger.warn('API response missing SourceConfig:', config);
|
||||
return [];
|
||||
}
|
||||
|
||||
// 确保 SourceConfig 是数组
|
||||
if (!Array.isArray(config.Config.SourceConfig)) {
|
||||
console.warn('SourceConfig is not an array:', config.Config.SourceConfig);
|
||||
logger.warn('SourceConfig is not an array:', config.Config.SourceConfig);
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user