review-logging-patterns

Replace console logging and generic errors with evlog wide events and structured createError() payloads.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you replace scattered console logging and generic error throwing with structured evlog wide events and self-documenting structured errors that include clear context, root cause, and actionable fixes.

Core Features & Use Cases

  • Console.log consolidation into wide events: Detects console.log spam and guides you to accumulate request/business context with log.set() and emit once per request or job.
  • Structured error transformation: Converts new Error(...) / throw Error(...) patterns into createError(...) objects with message, why, fix, optional link, and preserved cause.
  • Production-grade drain/enrichment setup guidance: Recommends correct drain pipeline usage, batching/retry/overflow safeguards, and enrichment/sampling/route service mapping across many frameworks.
  • Framework-specific guidance: Covers setup and usage patterns for Nuxt, Next.js, SvelteKit, Nitro, TanStack Start, React Router, NestJS, Express, Hono, Fastify, Elysia, Cloudflare Workers, and standalone TypeScript.

Quick Start

Ask an AI to review the codebase for console.* usage and generic error patterns, then propose concrete evlog replacements and a framework-appropriate setup for draining, enrichment, 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 spam with structured logging in TypeScript backends?

Replace console.log spam with structured logging by using evlog's log.set() to accumulate request and business context, then emitting a single wide event per request or job. This eliminates scattered logs and improves debugging visibility.

How do I create structured errors with context instead of throwing generic Error objects?

Create structured errors using the createError() payload, which replaces generic throw Error() patterns with self-documenting fields including message, why, fix, optional link, and preserved cause for clearer root cause analysis.

What is the best way to set up a logging drain pipeline for edge runtimes and Node.js frameworks?

Set up a production-grade logging drain pipeline by configuring batching, retry, and overflow safeguards, along with enrichment, sampling, and route service mapping tailored to frameworks like Next.js, Hono, Fastify, and Cloudflare Workers.

Does evlog structured logging work with Nuxt, NestJS, and SvelteKit backends?

Yes, evlog structured logging works with Nuxt, NestJS, SvelteKit, and many other frameworks including Express, Elysia, and TanStack Start, providing specific setup and usage patterns for request handlers and background jobs.

How do I detect logging anti-patterns during code reviews?

Detect logging anti-patterns during code reviews by applying YAML-discoverable guidance that checks for scattered console usage and generic error throws, enforcing contextual log.set() accumulation and structured createError() payloads.

When should I use wide events instead of standard console logging?

Use wide events instead of standard console logging when you need to consolidate scattered context into a single structured event per request or job, improving incident response and debugging across TypeScript/JavaScript backends.