review-logging-patterns

Review TypeScript codebases for logging anti-patterns and guide evlog structured logging adoption.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires evlog, @evlog/cli, and includes references (resource) components.

What problem does it solve? Scattered console.log statements, generic errors, and missing request context make production debugging painful. This Skill reviews TypeScript/JavaScript code for logging anti-patterns and guides adoption of evlog's wide events and structured errors across 15+ frameworks. ## Core Features & Use Cases - Code Review for Logging: Detects console.log spam, unstructured errors, and missing request context, with a full checklist and before/after transformation examples. - Framework Setup Guides: Step-by-step evlog integration for Nuxt, Nitro, Next.js, TanStack Start, Hono, SvelteKit, React Router, NestJS, Express, Fastify, Elysia, oRPC, Cloudflare Workers, AWS Lambda, Astro, and standalone TypeScript. - CLI-Driven Coverage: Uses @evlog/cli (evlog init, evlog map, --baseline) to wire logging, score entry-point coverage, and gate regressions in CI. - Use Case: Reviewing a Next.js API route that logs via console.log and throws generic Errors, then converting it to a single wide event with useLogger() and createError({ why, fix }). ## Quick Start Review the logging patterns in my API routes and suggest how to convert them to evlog wide events and structured errors.

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 with structured logging in TypeScript?

Replace scattered console.log calls with a request-scoped logger using useLogger() and accumulate context via log.set(), emitting one wide event per request. The skill provides before/after transformation examples for handlers, services, and background jobs.

How do I set up evlog in a Next.js or Nuxt project?

Run npx @evlog/cli init --dry-run --yes to preview the generated setup, then apply it with flags for service name, drains, and enrichers. Manual setup guides cover createEvlog() for Next.js and the evlog/nuxt module for Nuxt.

What is a wide event in logging?

A wide event is a single comprehensive log entry capturing all context for one logical operation, such as an HTTP request, instead of many scattered log lines. It typically includes user, business context, and outcome fields emitted once at request end.

Does evlog work with Express, Fastify, and Hono?

Yes, evlog provides dedicated middleware for Express, Fastify, Hono, Elysia, NestJS, and React Router, plus integrations for Cloudflare Workers, AWS Lambda, and Astro. Each exposes a request-scoped logger via useLogger() or request context.

How do I enforce logging coverage in CI?

Use evlog map --min-score 80 as an absolute gate or evlog map --baseline to fail CI when a PR regresses per-entry-point coverage compared to the committed evlog.map.json baseline. New uninstrumented routes are reported without failing the build.

Why should I use createError instead of throw new Error?

createError produces structured errors with message, why, fix, link, and cause fields, making failures self-documenting in logs and HTTP responses. Generic Error objects lack root-cause context and actionable remediation guidance.