Skip to content

Add logging to Python module #1

Description

@moksh-m9u

The backend (app/) currently lacks structured logging and error handling,
making it difficult to trace failures across the AI query pipeline.

Proposed Changes

  • Add Python's built-in logging module across the backend pipeline
  • Wrap critical operations in try/except blocks with errors logged at
    appropriate levels (DEBUG, WARNING, ERROR)

Target Areas

  • app/services/ — LLM calls, SQL generation, and self-correcting SQL retries
  • app/handlers/ — Business logic execution
  • app/api/ — Route-level request/response logging
  • app/db/ — Database connection and session errors

Benefits

  • Easier to trace where failures occur in the NL → SQL → execution pipeline
  • No new dependencies — stdlib logging only
  • Improves long-term maintainability of the backend

I'd like to work on this if you're open to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions