debug-package

Configure debug logger namespaces and format specifiers for LobeHub modules.

1|Updated May 9, 2026
One-click install
npx skills add https://github.com/duwenji/generative-ai-oss-tutorials --skill debug-package-duwenji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-package
Source: https://github.com/duwenji/generative-ai-oss-tutorials/tree/main/sandbox/lobe-chat/.agents/skills/debug-package
Command: npx skills add https://github.com/duwenji/generative-ai-oss-tutorials --skill debug-package-duwenji

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you diagnose why LobeHub logs are not appearing by guiding you to correctly use the debug npm package and the right DEBUG=lobe-* namespaces.

Core Features & Use Cases

  • Correct namespace selection: Use consistent logger namespaces for server, desktop, client, and router code to ensure logs route correctly.
  • Predictable log formatting: Use supported format specifiers like %O, %o, %s, and %d to inspect values effectively.
  • Enablement across environments: Turn on debug output for browser (via localStorage.debug), Node.js (via DEBUG env), and Electron (via process.env.DEBUG).
  • Use Case: When you add a new debug(...) logger for a router or client module but see no output, apply the namespace conventions and enable matching lobe-* debug filters to immediately restore visibility.

Quick Start

Enable debug output for the relevant LobeHub namespace by setting DEBUG (or localStorage.debug in the browser) to lobe-*.

Frequently Asked Questions about debug-package

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

FAQPage Schema
Why are my LobeHub debug logs not showing up when I run the server?

LobeHub debug logs fail to appear when the `debug` npm package namespaces are incorrectly scoped or missing. You must apply the correct `lobe-...` namespace pattern and set `DEBUG=lobe-*` to capture server, desktop, client, and router output.

How do I enable debug logging for LobeHub in the browser and Node.js?

To enable debug logging, set `localStorage.debug` in the browser or the `DEBUG` environment variable in Node.js to `lobe-*`. This routes diagnostic output for the matching `lobe-...` namespaces across your active modules.

What format specifiers does the debug npm package support for structured logging?

The debug package supports `%O`, `%o`, `%s`, and `%d` format specifiers for inspecting values. Using these supported formats ensures predictable log formatting when you add `debug(...)` instrumentation to LobeHub client or router modules.

How do I correctly scope a new debug logger for a LobeHub router module?

To scope a new debug logger, select the consistent `lobe-...` namespace pattern matching your router module. Applying this namespace convention and enabling the matching `DEBUG=lobe-*` filter immediately restores log visibility for troubleshooting.

Does enabling debug output work across Electron environments for LobeHub?

Yes, enabling debug output works in Electron by setting `process.env.DEBUG` to `lobe-*`. This environment variable configuration ensures structured logs route correctly for desktop modules alongside standard browser and Node.js setups.

What should I do if adding a debug logger produces no output in LobeHub?

When a new `debug(...)` logger produces no output, verify the `lobe-...` namespace selection matches the `DEBUG=lobe-*` filter. Correcting the namespace pattern and supported format specifiers immediately fixes missing runtime diagnostics.