Review logging patterns

Detect and improve logging patterns in TypeScript/JavaScript projects.

Updated Jun 22, 2024
One-click install
npx skills add https://github.com/Dyrean/dotfiles --skill review-logging-patterns-dyrean
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Review logging patterns
Source: https://github.com/Dyrean/dotfiles/tree/main/opencode/.config/opencode/skills/evlog
Command: npx skills add https://github.com/Dyrean/dotfiles --skill review-logging-patterns-dyrean

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Review and improve logging patterns in TypeScript/JavaScript projects by promoting wide events and structured errors.

Core Features & Use Cases

  • Detects console.log spam, unstructured errors, and missing request context.
  • Guides wide event design, structured error handling, and request-scoped logging.
  • Provides practical review checklists and integration patterns for Nuxt/Nitro and standalone scripts.

Quick Start

Provide an initial audit of a codebase by identifying logging anti-patterns and outlining concrete steps to apply evlog best practices.

Frequently Asked Questions about Review logging patterns

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

FAQPage Schema
What are wide events in structured logging and how do they improve code review?

Wide events are structured log entries containing comprehensive context about a single occurrence. They improve code review by replacing scattered console spam and generic errors with cohesive, context-rich data that is easier to trace and analyze.

How do I fix unstructured console.log spam and generic errors in TypeScript projects?

To fix unstructured console.log spam and generic errors, audit your codebase to identify logging anti-patterns and implement structured error handling. Use utilities like useLogger or createError to enforce context, error-wrapping, and safe data handling.

Does this structured logging approach work with Nuxt and Nitro API routes?

Yes, this structured logging approach works with Nuxt and Nitro API routes. It supports auto-emission in Nuxt/Nitro environments and provides specific integration patterns for API routes and front-end components to ensure request-scoped logging.

How do I add request-scoped context to logs in a JavaScript application?

You add request-scoped context to logs by integrating with a logging utility like useLogger. This transforms scattered logs into cohesive wide events, ensuring every log entry contains the necessary request context and safely handles data.

Do I need a specific logging utility to implement structured wide events?

Yes, implementing structured wide events requires integration with logging utilities such as useLogger or createError. These utilities enforce context, structured error-wrapping, and safe data handling to replace unstructured logging patterns.

When should I avoid using wide events for structured error handling?

You should avoid using wide events for structured error handling when working in standalone scripts without integration support for useLogger or createError, as the approach relies on framework-specific auto-emission and request-scoped context.