Skip to content

feat: implement centralized structured logger utility #24

@rohansaini-02

Description

@rohansaini-02

Context

Ref: #1 — Native GovTech Learning App for Public Education Systems

As the codebase grows to include complex background syncs and API integrations, debugging via standard console output becomes unmanageable, especially on mobile devices.

Problem

Modules currently rely on raw console.log and console.error statements.

  1. No Filtering — It is impossible to filter logs by severity (e.g., only show errors).
  2. Missing Context — It is difficult to identify which module or component produced a specific log entry.
  3. Production Limitations — Raw console logs complicate integration with production crash reporting tools later on.

Proposed Solution

Implement a standalone Logger utility in a new shared-utils/logger directory to standardize logging across all modules.

Core Features

Feature Description
Severity Levels Supports DEBUG, INFO, WARN, and ERROR classifications.
Module Tagging Requires a context string (e.g., [FrappeClient]) to trace logs to their source.

Deliverables

  • Centralized Logger class is implemented.
  • Severity levels and module context tagging are supported.
  • Code resides in an independent shared-utils/logger directory.

Why This Matters

A structured logger is a standard engineering practice that will save countless hours of debugging. It ensures that when the app goes into production, we have a clear, filterable trail of application behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions