Skip to content

[P2] Replace Print Statements With Structured Logging #17

Description

@barvhaim

Roadmap Item 11: Replace Print Statements With Structured Logging

Priority: P2
Area: Observability
References: src/threatxtension/api/database.py,
src/threatxtension/core/extension_downloader.py,
src/threatxtension/llm/prompts/__init__.py

Several modules still print operational warnings and errors. Structured logging is
needed for containers, demos, and debugging failed scans.

Scope:

  • Replace library print() calls with module loggers.
  • Add request/job identifiers to relevant scan logs.
  • Configure log level via environment variable.
  • Avoid logging secrets, full uploaded file contents, or API keys.

Acceptance criteria:

  • Backend modules use logging instead of print() for operational messages.
  • Docker logs include timestamps and log levels.
  • Tests or lint rules prevent new print() usage in src/.

Created from docs/roadmap.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestobservabilityLogging, metrics, and diagnostics

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions