Skip to content

fix: downgrade resource module ImportError log from warning to debug on Windows - #187

Merged
xhluca merged 4 commits into
mainfrom
copilot/fix-logger-warning-windows-import
May 13, 2026
Merged

fix: downgrade resource module ImportError log from warning to debug on Windows#187
xhluca merged 4 commits into
mainfrom
copilot/fix-logger-warning-windows-import

Conversation

Copilot AI commented May 6, 2026

Copy link
Copy Markdown
Contributor
  • Change logger.warning to logger.debug at import time (no stderr noise on every import)
  • Add logger.warning inside get_max_memory_usage when resource is None (warn only when the feature is actually attempted)
  • Update test to match the new warning message

Copilot AI changed the title [WIP] Fix logger warning during imports on Windows fix: downgrade resource module ImportError log from warning to debug on Windows May 6, 2026
Copilot finished work on behalf of xhluca May 6, 2026 05:15
Copilot AI requested a review from xhluca May 6, 2026 05:15
@xhluca

xhluca commented May 6, 2026

Copy link
Copy Markdown
Owner

@copilot that's fine but warning should be inside the usage of resource

Copilot AI commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot that's fine but warning should be inside the usage of resource

Done in 8b17975. The logger.warning is now inside get_max_memory_usage (when resource is None and memory usage is actually requested), while the import-time handler uses logger.debug to avoid spurious stderr output on every import.

Copilot finished work on behalf of xhluca May 6, 2026 05:17
@xhluca
xhluca marked this pull request as ready for review May 6, 2026 21:56
@xhluca

xhluca commented May 8, 2026

Copy link
Copy Markdown
Owner

@copilot fix the error

Copilot AI commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the error

Fixed in 62d6bbe. The CI failure was a test asserting the old warning message "resource module not available on Windows" — updated it to match the new message "resource module not available, cannot get memory usage" that's now emitted at the usage site.

Copilot finished work on behalf of xhluca May 8, 2026 01:27
@xhluca
xhluca merged commit c37c81c into main May 13, 2026
4 checks passed
@xhluca
xhluca deleted the copilot/fix-logger-warning-windows-import branch May 13, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logger.warning on every import breaks MCP health checks on Windows

2 participants