Skip to content

feat(core): implement centralized structured json log manager module …#258

Open
Hrithik-ui753 wants to merge 1 commit into
sahoo-tech:mainfrom
Hrithik-ui753:feat/structured-logging-logger-232
Open

feat(core): implement centralized structured json log manager module …#258
Hrithik-ui753 wants to merge 1 commit into
sahoo-tech:mainfrom
Hrithik-ui753:feat/structured-logging-logger-232

Conversation

@Hrithik-ui753
Copy link
Copy Markdown
Contributor

📝 Description

This PR addresses Phase 1 of the Structured Logging feature request (#232). It introduces a central logging utility architecture that formats log records into structured, predictable JSON objects instead of plain-text strings, setting up foundation blocks for system observability.

🚀 Feature Reference

Closes part of #232 (PR 1/3)

🛠️ Changes Made

  • Created core/utils/logger.py containing a robust JSONFormatter.
  • Implemented get_structured_logger(module_name) to support module-isolated log identification.
  • Added support for extra structural keyword fields (action, status) to match the proposed specification payload format.
  • Suppressed root logger propagation to eliminate text-formatting collisions with default console streams.

📊 Standardized Output Verification

Calling the tracker emits the following schema structure flawlessly:

{
  "timestamp": "2026-05-21T10:30:00.123456",
  "level": "INFO",
  "module": "trust_scorer",
  "message": "calculate_score processing completed",
  "action": "calculate_score",
  "status": "success"
}

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.

1 participant