Skip to content

Add structured logging and replace print() diagnostics across project#221

Open
lil-aditya wants to merge 2 commits intofireform-core:mainfrom
lil-aditya:enhancement
Open

Add structured logging and replace print() diagnostics across project#221
lil-aditya wants to merge 2 commits intofireform-core:mainfrom
lil-aditya:enhancement

Conversation

@lil-aditya
Copy link

Summary

This PR introduces structured logging across the FireForm project and replaces scattered print() statements with a centralized logging system.

The goal is to improve observability, debugging, and production readiness.


Changes

1. Structured Logger Utility

Added a reusable logger utility:

This provides:

  • timestamped logs
  • severity levels (INFO, DEBUG, ERROR)
  • module names
  • consistent formatting

2. Replace print() Diagnostics

Replaced print() statements with structured logging in:

  • src/main.py
  • src/file_manipulator.py
  • src/llm.py

3. API Improvements

Enhancements in api/main.py:

  • Added request logging middleware
  • Registered exception handlers
  • Added /health endpoint for uptime monitoring

Benefits

  • Consistent logging across the codebase
  • Better debugging and production diagnostics
  • Structured logs with severity levels
  • Request logging for the API
  • Health endpoint for monitoring

Files Changed

  • src/logger.py (new)
  • src/main.py
  • src/file_manipulator.py
  • src/llm.py
  • api/main.py

fixes #220

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.

[FEAT] Add structured logging across the project and replace print() diagnostics

1 participant