feat: implement centralized structured logger utility (#24)#34
Open
rohansaini-02 wants to merge 2 commits into
Open
feat: implement centralized structured logger utility (#24)#34rohansaini-02 wants to merge 2 commits into
rohansaini-02 wants to merge 2 commits into
Conversation
f80d746 to
e074c98
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implementation of a decoupled Centralized Structured Logger Utility Proof of Concept (PoC). This module provides a robust, standardized way to log events, warnings, and errors across the entire TAP Buddy app with context tagging, severity filtering, and a pluggable transport layer for future crash analytics integrations.
Related Issue
Resolves #24
Problem Statement
As the codebase grows with complex background synchronizations (Issue #13) and DIKSHA content interactions (Issue #14), debugging via standard console output becomes unmanageable. We need a standardized logger with filtering, metadata support, and clear context tagging to pinpoint exactly which module is generating a log.
Changes Made
shared-utils/loggerstandalone TypeScript package.LoggerClass Implementation: Built a highly configurable Logger supporting global and instance-level severity filtering.DEBUG,INFO,WARN, andERRORlevels with cascading priority logic.[Context]) and optional serialized metadata.Logger.setGlobalTransport()to allow injecting custom log handlers (e.g., for sending logs to Sentry or Crashlytics in production) while falling back to natively formatted console methods..gitignoreto keep the module structure clean and free of build artifacts.Technical Decisions
LogMessageandLogLevelinterfaces to guarantee downstream modules feed the logger the correct, type-safe data shapes.Testing Performed
manual_test.ts) to visually confirm output formats and ensure the console fallback mechanism gracefully handles all severity levels and metadata edge cases.Results
A fully testable, type-safe logging utility that provides the foundation for deep observability during offline-first syncing.
Checklist