debug
Debug package implementation guide for LobeHub. Provides standardized logging patterns, namespace conventions, and configuration for browser, Node.js, and Electron environments.
Introduction
This skill provides a comprehensive guide for developers working within the LobeHub ecosystem to implement, manage, and configure debug logging. By standardizing the use of the 'debug' package, it ensures that log output across the platform is consistent, searchable, and manageable during development and troubleshooting. This is intended for software engineers, plugin developers, and contributors working on LobeHub server-side routers, desktop application modules, or client-side components.
-
Standardized namespace conventions for modular tracking across Desktop, Server, Client, and Router components.
-
Practical configuration instructions for enabling debug output in browser consoles, Node.js terminal environments, and Electron process logs.
-
Comprehensive format specifiers usage including %O for expanded object inspection, %o, %s, and %d, facilitating precise debugging of complex variables and application state.
-
Implementation examples for common LobeHub code paths, such as agent market routers and network requests.
-
When implementing logging, always follow the established namespace format: lobe-[module]:[submodule].
-
For browser-based environments, use local storage configuration (localStorage.debug = 'lobe-*') for quick debugging sessions.
-
For Node.js or Electron applications, utilize environment variables (DEBUG=lobe-*) to control log verbosity without altering core application code.
-
Always prioritize %O for logging objects, as it provides the most useful and expandable output in the console during development.
-
This tool is specifically designed for developers; it is not meant for production-level observability but rather for active development, local environment testing, and identifying integration issues within the LobeHub codebase.
Repository Stats
- Stars
- 75,822
- Forks
- 15,036
- Open Issues
- 746
- Language
- TypeScript
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- Apr 29, 2026, 06:07 AM