Implement configurable logging system to replace print statements#28
Draft
Copilot wants to merge 4 commits into
Draft
Implement configurable logging system to replace print statements#28Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Co-authored-by: Bilpapster <59035668+Bilpapster@users.noreply.github.com>
Co-authored-by: Bilpapster <59035668+Bilpapster@users.noreply.github.com>
Co-authored-by: Bilpapster <59035668+Bilpapster@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add configurable logging mechanism with default values
Implement configurable logging system to replace print statements
Oct 15, 2025
11 tasks
65f98bd to
0b8b9e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a unified, configurable logging system for Stream DaQ that replaces scattered
print()statements with proper logging management. The solution provides sensible defaults while allowing users to customize verbosity levels and output formatting.Motivation
Previously, Stream DaQ used a mix of
print()statements and logging calls across different modules:StreamDaQ.pyused print statements for user feedbackSchemaValidator.pyused logging for validation eventsutils.pyconfigured logging independentlyThis inconsistency made it difficult for users to control output verbosity and resulted in a fragmented logging experience.
Changes
1. Centralized Logging Configuration
Created a new
streamdaq/logging_config.pymodule that provides:2. Unified Print Statements
Replaced print statements in
StreamDaQ.pywith appropriate logging calls:print("Data set to artificial...")→logger.info(...)print("Violations sink is being set!")→logger.debug(...)3. Updated Existing Logging
utils.py: Removed manuallogging.basicConfig()configuration, now uses centralized loggingSchemaValidator.py: Updated to use centralized logger initializationAll modules now follow a consistent pattern:
4. Public API
Exported logging configuration functions in
streamdaq/__init__.py:configure_logging()- Full configuration controlset_level()- Quick verbosity changesget_current_level()- Query current level5. Documentation & Examples
docs/concepts/logging.rst- Comprehensive guide covering quick start, common scenarios, API reference, and best practicesexamples/logging_configuration.py- Demonstrates 6 different logging configurationsREADME.mdanddocs/concepts/index.rstto reference logging featureUsage Examples
Default Behavior (INFO level)
Development - Verbose Output
Production - Minimal Output
Custom Formatting
Benefits
set_level(logging.WARNING)set_level(logging.DEBUG)loggingmoduleTesting
Migration Guide
For Users
No action required! The default INFO level provides output similar to previous versions. To customize:
For Contributors
Use the centralized logger in new code:
Closes #[issue_number]
Original prompt
Fixes #27
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.