console-log

Defines console logging level conventions for the Ledger Live monorepo.

615|491|Updated Jan 4, 2022
One-click install
npx skills add https://github.com/LedgerHQ/ledger-live --skill console-log
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: console-log
Source: https://github.com/LedgerHQ/ledger-live/tree/main/.agents/skills/console-log
Command: npx skills add https://github.com/LedgerHQ/ledger-live --skill console-log

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent use of console.error and console.warn across a monorepo pollutes monitoring tools like Datadog RUM and Sentry with noise, making real errors hard to spot. This Skill establishes a clear convention so logs are routed correctly.

Core Features & Use Cases

  • Error Level Discipline: Reserves console.error exclusively for illegal or unexpected program states that should never occur in production.
  • Warning Guidance: Directs expected or recoverable failures (network issues, unavailable optional features) to console.warn.
  • Noise Reduction: Encourages dropping logs entirely when an error is neither actionable nor surprising.
  • Use Case: When adding error handling to a new feature in the Ledger Live monorepo, consult this convention to choose the correct console level so monitoring dashboards stay clean.

Quick Start

Ask the AI to review your new code's console logging statements and align them with the monorepo's console.error and console.warn convention.

Frequently Asked Questions about console-log

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

FAQPage Schema
When should I use console.error vs console.warn?

Use console.error only for illegal or unexpected program states that should never occur in production. Use console.warn for expected or recoverable errors such as network failures or unavailable optional features.

Why does console.error trigger alerts in Datadog RUM and Sentry?

Monitoring tools like Datadog RUM and Sentry intercept console.error calls and forward them as error events. Logging recoverable issues with console.error creates false error signals and alert noise.

Should I log every caught exception in JavaScript?

No. If an error is neither actionable nor surprising, prefer dropping the log entirely. Logging everything floods monitoring dashboards and obscures genuinely unexpected failures.

Does this logging convention apply outside the Ledger Live monorepo?

The convention is written for the Ledger Live monorepo where console.error is intercepted by Datadog RUM and Sentry, but the same principles apply to any project using similar monitoring tools.