Skip to content

feat(lsp): add logger package with pino integration #36

Description

@amondnet

Summary

Create a shared logger package for consistent logging across the monorepo.

Motivation

  • Structured logging needed for debugging MCP communication
  • Consistent log format across packages (code, dora, lsp, format)
  • Performance-critical for MCP server

Implementation

Package: packages/logger

  • Create new @pleaseai/logger package
  • Integrate pino as the logging library
  • Add pino-pretty for development mode
  • Configure structured JSON output for production
  • Export typed logger factory

Features

  • Log levels: trace, debug, info, warn, error, fatal
  • Child loggers with context (e.g., logger.child({ tool: "findSymbol" }))
  • Environment-based configuration (LOG_LEVEL env var)
  • Pretty printing in development, JSON in production
  • Redaction of sensitive fields

Integration

  • Integrate with @pleaseai/dora (MCP server)
  • Integrate with @pleaseai/code (CLI)
  • Integrate with @pleaseai/code-lsp (LSP client)

API Design

import { createLogger } from "@pleaseai/logger"

const logger = createLogger("dora")
logger.info({ tool, query }, "MCP request received")
logger.error({ err }, "Request failed")

// Child logger with context
const toolLogger = logger.child({ tool: "findSymbol" })
toolLogger.debug({ query }, "Searching symbols")

Why pino?

  • Fastest Node.js logger
  • Small bundle size (~8KB)
  • Excellent Bun support
  • Native structured logging
  • Strong TypeScript support

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    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