-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Problem / Background
Several production code files use bare print() statements instead of the project's structured logging (structlog / logging). This makes it harder to control log levels, filter output, and integrate with observability tools in production deployments.
Goal
Replace all print() calls in non-test production code with appropriate logger calls using the existing logging infrastructure.
Proposed Solution
Add a module-level logger and replace print() with the appropriate log level:
import structlog
logger = structlog.get_logger(__name__)
# Instead of: print("Migration completed successfully.")
# Use: logger.info("Migration completed successfully.")Affected files:
cognee/run_migrations.py:45,48— Migration status messagescognee/modules/users/get_user_manager.py:62,67,72— User registration/verification events (3 instances)cognee/tasks/temporal_awareness/build_graph_with_temporal_awareness.py:27,37— Graph initialization and data processing status
Acceptance Criteria
- All
print()calls in the listed files are replaced with logger calls - Appropriate log levels are used (
infofor success,warning/errorfor failures,debugfor verbose output) - Logger is initialized at module level following existing patterns in the codebase
- Sensitive data (tokens, user IDs) is not logged at INFO level — use DEBUG
-
ruff check .passes - No test files are modified (print in tests is acceptable)
Dependencies / Blockers
None. Note: issue #2039 covers a similar concern for the metrics module specifically — this issue covers the remaining files.
Relevant Links / Resources
- Existing logging setup:
cognee/shared/logging_utils.py - The project uses
structlog— check existing patterns in other modules for consistency
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed