Skip to content

[Feature]: Replace custom logger with pino #1065

@eddieajau

Description

@eddieajau

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I am describing a concrete problem or use case, not just a vague idea.

Area

apps/server

Problem or use case

The custom logger outputs human-readable ANSI text with a bespoke key=value context format. This makes log output hard to consume programmatically — by agents, log aggregators, or anything that isn't a human eyeballing a TTY.

Proposed solution

Replace with pino. Use pino-pretty in development for the human-readable output the current logger provides. Use structured JSON in production.

Why this matters

T3Code is a substrate for AI agents. Structured logs are part of the interface agents use to understand runtime behaviour. The current logger silently truncates values, has no numeric log levels, and produces output no standard tooling can parse.

Smallest useful scope

Swap createLogger for a pino instance with equivalent scope/child logger semantics. Keep the event level or map it to info with a type: "event" field.

Alternatives considered

The current implementation is clean and readable. Keeping it and adding JSON output mode is possible but means maintaining something pino already solved.

Risks or tradeoffs

pino-pretty adds a dev dependency. Log output format changes, which may affect anything already consuming logs. The custom event level has no pino equivalent and needs a decision.

Examples or references

pino — authored by Matteo Collina (Node.js core contributor). Used in Fastify, NestJS, and most serious Node production backends.

Contribution

  • I would be open to helping implement this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequested improvement or new capability.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions