Skip to content

Conversation

@sahiljhawar
Copy link
Collaborator

Closes #24

This pull request introduces a mechanism to warn users if a logger has not been instantiated when importing the swvo package, and adds tests to verify this behavior.

Logger initialization warning:

  • Added code in swvo/__init__.py to check for logger handlers and print a colored warning if none are present, along with instructions for basic logger instantiation.

Testing logger warning behavior:

  • Added tests/io/test_logger.py to test that the logger warning is printed when no handlers are present, and not printed when handlers exist, for both swvo and swvo.io modules.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a warning mechanism to alert users when the swvo package is imported without a logger being configured, improving user experience by providing clear guidance on logger setup.

  • Added logger initialization check with colored warning messages in swvo/__init__.py
  • Created comprehensive tests to verify warning behavior for both presence and absence of logger handlers
  • Tests cover both swvo and swvo.io module imports to ensure consistent behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
swvo/__init__.py Added logger handler check with colored warning output and setup instructions
tests/io/test_logger.py Added parameterized tests to verify warning behavior across different modules

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@DoctorRabbit55 DoctorRabbit55 merged commit 6bb2878 into GFZ:main Sep 24, 2025
5 of 8 checks passed
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.

add a verbose message if logger is not instantiated

2 participants