Skip to content

fix: replace print() with logger.warning() in presets catalog warning - #3970

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/presets-use-logger
Open

fix: replace print() with logger.warning() in presets catalog warning#3970
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/presets-use-logger

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Problem

print(..., file=sys.stderr) bypasses the logging framework and cannot be silenced or redirected by consumers.

Fix

Replaced with logger.warning() for proper log management. Removed unused sys import.

Print to stderr is inappropriate for library code. Replaced with
logger.warning() for proper log management. Removed unused sys import.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces direct stderr output with module logging for configurable preset catalog warnings.

Changes:

  • Adds a module-level logger.
  • Emits the non-default catalog warning through logger.warning().
  • Removes the local sys import.
Show a summary per file
File Description
src/specify_cli/presets/__init__.py Routes catalog warnings through Python logging.

Review details

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +4268 to 4271
logger.warning(
"Using non-default preset catalog. "
"Only use catalogs from sources you trust.",
file=sys.stderr,
)
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.

3 participants