logger

Implement a zero-dependency TypeScript logging library with HTTP transport.

2|Updated Aug 8, 2024
One-click install
npx skills add https://github.com/walid-mos/mac-config --skill logger-walid-mos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logger
Source: https://github.com/walid-mos/mac-config/tree/main/claude/.claude/skills/logger
Command: npx skills add https://github.com/walid-mos/mac-config --skill logger-walid-mos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a consistent and robust logging solution for Node.js applications, ensuring that logs are structured, informative, and easy to manage across different environments.

Core Features & Use Cases

  • Zero-dependency TypeScript logger: Lightweight and efficient logging.
  • Multiple Export Paths: Core logger, testing utilities, and an HTTP transport.
  • Environment-aware Formatting: Automatically adapts output for Node.js terminals, browser DevTools, or JSON for production.
  • Use Case: Integrate this logger into your backend service to capture application events, errors, and performance metrics in a structured format, making debugging and monitoring significantly easier.

Quick Start

Import the default logger and log an informational message with scope and details.

Frequently Asked Questions about logger

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

FAQPage Schema
How do I implement structured logging in a Node.js application?

Structured logging in a Node.js application is implemented using a zero-dependency TypeScript library that enforces defined types for log levels, environments, and entries. This ensures logs are formatted consistently across different environments.

What is the best way to format logs differently for Node.js terminals and browser DevTools?

Environment-aware formatting automatically adapts log output for Node.js terminals, browser DevTools, or JSON for production. This mechanism ensures readable logs locally and structured data in live environments.

Can I use a zero-dependency TypeScript logger in web workers?

Yes, this logging library supports web workers, browsers, and Node.js environments. It provides multiple export paths for core functionality, allowing you to maintain structured logging across an entire stack.

How do I send logs to an HTTP endpoint with batching and retries?

You can send logs to an HTTP endpoint using the dedicated HTTP transport export path built into the library. This transport handles network logging automatically with built-in batching and retry mechanisms.

How do I test structured log entries in a TypeScript application?

Testing structured log entries is handled through a dedicated testing utilities export path. This provides specific tools to verify log levels, scopes, and entry details without altering the core logger implementation.