-
Notifications
You must be signed in to change notification settings - Fork 1
Complete migration to loguru, remove LogUtils entirely, and optimize codebase #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…atibility Co-authored-by: Colin955023 <[email protected]>
…ize dict merge and path handling, update documentation Co-authored-by: Colin955023 <[email protected]>
…, improve time constants calculation Co-authored-by: Colin955023 <[email protected]>
|
@copilot |
Co-authored-by: Colin955023 <[email protected]>
Co-authored-by: Colin955023 <[email protected]>
|
@copilot |
Co-authored-by: Colin955023 <[email protected]>
…th packaging library Co-authored-by: Colin955023 <[email protected]>
Remove component parameter from logger calls since logger is already bound at module level: - src/utils/ui_utils.py: Remove component parameter from lines 357, 364, 369, 504 - src/ui/mod_management.py: Fix logger.bind().error() pattern on lines 348-350 - src/core/server_manager.py: Remove component parameter from line 435-436 - src/ui/main_window.py: Remove component parameter from line 321 - src/ui/server_monitor_window.py: Remove component and exception parameters from lines 61-64, 118-120 Co-authored-by: Colin955023 <[email protected]>
已完成所有要求的修改:
|
…ds 10MB Co-authored-by: Colin955023 <[email protected]>
|
@copilot |
Co-authored-by: Colin955023 <[email protected]>
已修改 src/utils/init.py,移除了已過時的 LogUtils 相關匯出:
其他 init.py 文件(src/core、src/ui、src/models、src/version_info)已檢查,結構良好無需修改。 Commit: dcca20d |
|
@copilot |
Co-authored-by: Colin955023 <[email protected]>
|
@copilot |
目前的實作已經支援您要的效果! # 完全支援這種方式
from src.utils import get_logger, HTTPUtils, UIUtils, ensure_dir, get_cache_dir
# 使用範例
logger = get_logger().bind(component="MyComponent")
http_utils = HTTPUtils()這與 HTTPUtils、UIUtils 等的導入方式完全一致,使用相同的 lazy import 機制。 Commit: e99b8b5 已實現此功能。 |
Complete Loguru Migration and Code Optimization - COMPLETE ✅
Logging Implementation
src/utils/log_utils.pyand replaced all 326 LogUtils calls with direct loguru usagelogger = get_logger().bind(component="ComponentName")get_loggerexport tosrc/utils/__init__.pyfor simplified imports:from src.utils import get_logger%LOCALAPPDATA%/Programs/MinecraftServerManager/log/YYYY-MM-DD-HH-mm.logCode Optimizations
packaging.version.VersionQuality Assurance
Import Usage Examples
Recent Updates
get_loggerexport tosrc/utils/__init__.pyfor convenient importsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.