Commit Graph

7 Commits

Author SHA1 Message Date
Phantom
14c3b11664
docs(logger): update logger docs (#8436)
* docs(logger): 更新日志使用文档的格式和内容

- 补充记录非object类型上下文信息的示例
- 修正环境变量格式为代码样式
- 统一中英文文档的标点符号和格式
- 修复文档中的拼写错误和示例错误

* docs: 修正日志使用文档中的标点格式

统一中英文文档中关于调用方式说明的标点格式,将中文文档的冒号改为句号以保持一致性

* docs(technical): 修正日志使用文档中的代码块标记

将环境变量示例的代码块标记从env改为bash以正确高亮显示

* docs(technical): 修正日志级别文档中的示例格式
2025-07-24 08:16:47 +08:00
fullex
c2086fdb15
refactor[Logger]: strict type check for Logger (#8363)
* fix: strict type check of logger

* feat: logger format in renderer

* fix: error type
2025-07-23 13:24:03 +08:00
one
736f73a726
refactor: match provider and model using a consistent method (#7933)
* refactor: match provider and model using a consistent method

* refactor: use keywords matching across model selectors

* refactor: update match, reuse getFancyProviderName

* refactor: use modelSelectFilter in knowledgebase settings

* refactor: use filter in ModelList

* refactor: add filterModelsByKeywords

* refactor: add getModelSelectOptions

* style: better function names

* fix: update effect dependencies in popup and panel components

Adjusted dependency arrays in HtmlArtifactsPopup and QuickPanelView to ensure correct effect execution. This change improves state synchronization and prevents unnecessary updates.

* refactor: use match in memory settings

* refactor: add avatar to model selector

* refactor: simplify utils, move select options to components

* docs: add comments

* refactor: move filter to SelectOptions

* test: add tests for SelectOptions

* test: remove type mock

* refactor: use match in EditModelsPopup

* refactor: use SelectOptions in SelectProviderModelPopup, add more tests

* fix: api check model select

* refactor: improve websearch rag model select style

* refactor: add a ModelSelector

* test: update tests for ModelSelector

* docs: comments

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
2025-07-23 10:45:09 +08:00
one
2b0c46bfdb
refactor: model list and health check (#7997)
* refactor(ProviderSetting): add a backtop to provider setting

* refactor: decouple ModelList from ProviderSetting

* refactor: move modellist to a single dir

* refactor: allow more props for CollapsibleSearchBar

* refactor: split ModelList into ModelList, ModelListGroup and ModelListItem

* refactor: simplify health check types, improve file structure

* refactor: split HealthStatusIndicator from list items

* refactor: better indicator tooltip

* refactor: improve model search, simplify some expressions

* refactor: further simplify ModelList by extracting onHealthCheck

* refactor: remove double scroller from EditModelsPopup

* revert: remove backtop

* fix: i18n order

* refactor: sort buttons
2025-07-21 15:57:08 +08:00
fullex
5204438c0c
refactor[Logger]: filtering logs with environment variable (#8299)
refactor(Logger): enhance logging with environment variable support

- Updated LoggerService to utilize environment variables for filtering logs by level and module in development mode.
- Modified the logging level handling to use constants from the logger configuration.
- Enhanced documentation to include details on using environment variables for log filtering in both English and Chinese documentation files.
- Cleaned up unused type definitions related to logging.
2025-07-21 09:37:48 +08:00
fullex
2e77792042
fix[Logger]: in renderer worker (#8284)
* docs: enhance LoggerService documentation and usage guidelines

- Added details about `initWindowSource` method, emphasizing its return of the LoggerService instance for method chaining.
- Introduced a section on using LoggerService within `worker` threads, highlighting the need to call `initWindowSource` first.
- Updated both English and Chinese documentation files to reflect these changes, ensuring clarity in usage instructions for developers.

* docs: update LoggerService documentation and improve environment checks

- Enhanced documentation for using LoggerService in worker threads, clarifying logging support limitations in main and renderer processes.
- Added environment checks for development and production modes directly in the LoggerService.
- Removed the unused env utility file to streamline the codebase.

* refactor(ShikiStreamService): update highlighter management and improve test assertions

- Modified the highlighter management in ShikiStreamService to clear the reference instead of disposing it directly, as it is now managed by AsyncInitializer.
- Enhanced unit tests to verify the initialization of worker and main highlighters, ensuring that either one is active but not both, and updated assertions related to highlighter disposal.
2025-07-19 15:28:36 +08:00
fullex
40f9601379
refactor: Unified Logger / 统一日志管理 (#8207)
* Revert "feat: optimize minapp cache with LRU (#8160)"

This reverts commit f0043b4be5.

* feat: integrate logger service and enhance logging throughout the application

- Added a new LoggerService to standardize logging across the application.
- Replaced console.error and console.warn calls with logger methods for improved consistency and error tracking.
- Introduced a new IPC channel for logging messages to the main process.
- Updated various components and services to utilize the new logging system, enhancing error handling and debugging capabilities.

* refactor: enhance logging and error handling across various components

- Integrated the LoggerService for consistent logging throughout the application.
- Updated multiple components and services to utilize the new logging system, improving error tracking and debugging capabilities.
- Refactored file handling and error management in several services to enhance reliability and clarity.
- Improved the structure and readability of the codebase by removing redundant checks and simplifying logic.

* chore: update TypeScript configuration and enhance test setup

- Added test mock paths to tsconfig.web.json for improved test coverage.
- Configured Vitest to include a setup file for main tests, ensuring consistent test environment.
- Updated IPC logger context for better clarity in logging.
- Enhanced LoggerService to handle undefined values gracefully.
- Mocked LoggerService globally in renderer tests to streamline testing process.

* refactor: standardize logging across ProxyManager and ReduxService

- Replaced instances of Logger with logger for consistent logging implementation.
- Improved logging clarity in ProxyManager's configureProxy method and ReduxService's state handling.
- Enhanced error logging in ReduxService to align with the new logging system.

* refactor: reorganize LoggerService for improved clarity and consistency

- Moved the definition of SYSTEM_INFO, APP_VERSION, and DEFAULT_LEVEL to enhance code organization.
- Simplified the getIsDev function in the renderer LoggerService for better readability.
- Updated logging conditions to ensure messages are logged correctly based on context.

* docs: add usage instructions for LoggerService and clean up logging code

- Included important usage instructions for LoggerService in both English and Chinese.
- Commented out the console transport in LoggerService to streamline logging.
- Improved logging message formatting in MCPService for clarity.
- Removed redundant logging statements in SelectionService to enhance code cleanliness.

* refactor: update LoggerService documentation paths and enhance logging implementation

- Changed the documentation paths for LoggerService usage instructions to `docs/technical/how-to-use-logger-en.md` and `docs/technical/how-to-use-logger-zh.md`.
- Replaced console logging with the loggerService in various components, including `MCPSettings`, `BlockManager`, and multiple callback files, to ensure consistent logging practices across the application.
- Improved the clarity and context of log messages for better debugging and monitoring.

* docs: emphasize logger usage guidelines in documentation

- Added a note in both English and Chinese documentation to discourage the use of `console.xxx` for logging unless necessary, promoting consistent logging practices across the application.
2025-07-18 09:40:56 +08:00