review-logging-patterns

Review TypeScript and JavaScript code for console logging anti-patterns and recommend structured wide events.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/andreasasprou/polaris --skill review-logging-patterns-andreasasprou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: review-logging-patterns
Source: https://github.com/andreasasprou/polaris/tree/main/.agents/skills/review-logging-patterns
Command: npx skills add https://github.com/andreasasprou/polaris --skill review-logging-patterns-andreasasprou

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Many TypeScript/JavaScript codebases rely on scattered console logs and generic errors that make debugging and observability difficult; this Skill helps reviewers and engineers convert noisy, unstructured logging into consistent, queryable wide events with meaningful context.

Core Features & Use Cases

  • Cross-framework guidance: Step-by-step patterns and integration tips for Nuxt, Next.js, SvelteKit, Nitro, TanStack Start, NestJS, Express, Hono, Fastify, Elysia, Cloudflare Workers, Vite, and standalone TypeScript.
  • Log modernization: Detects console.log spam, flat or abbreviated payloads, missing request context, and recommends replacing them with evlog wide events and context enrichment.
  • Error hygiene and drains: Advises structured errors, integration with drain adapters (Axiom, OTLP, PostHog, Sentry, Better Stack, filesystem), sampling and tail sampling strategies, enrichers, and drain-pipeline production patterns.
  • AI observability: Guidance for capturing token usage, tool calls, and streaming metrics from AI SDKs into wide events and for avoiding anti-patterns in AI telemetry.
  • Review tooling: Includes checklists and suggested review comments to accelerate code reviews and migrations.

Quick Start

Run a repository scan to find console.log and generic throw new Error patterns and propose replacing them with evlog wide events, createError structured errors, and a production drain pipeline.

Frequently Asked Questions about review-logging-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I replace console.log spam with structured logging in TypeScript?

To replace console.log spam with structured logging in TypeScript, scan your codebase to detect unstructured logs and convert them into queryable wide events using evlog, while adding enrichers for missing request context.

What is the best way to set up a log drain pipeline for Nuxt or Next.js?

The best way to set up a log drain pipeline for Nuxt or Next.js is to route structured wide events through drain adapters like Axiom, Sentry, or Better Stack, applying sampling strategies and enrichers for production observability.

Does this logging modernization approach work with Cloudflare Workers and Hono?

Yes, this logging modernization approach works with Cloudflare Workers and Hono, providing cross-framework guidance to integrate evlog wide events, structured errors, and drain configurations across various TypeScript environments.

How do I capture AI observability metrics like token usage in structured logs?

To capture AI observability metrics like token usage in structured logs, apply specific patterns to capture tool calls and streaming metrics from AI SDKs into wide events, avoiding common AI telemetry anti-patterns.

Why should I use structured wide events instead of generic throw new Error?

You should use structured wide events instead of generic throw new Error because structured errors provide meaningful context and queryability, replacing flat payloads and missing request context with consistent, debuggable observability data.