# Debug Package Logging for Lobe Framework

Configure and use debug logging in Lobe framework applications for debugging modules like server, client, and router. The deliverable is formatted log output for specific modules, such as 'lobe-server:market' or 'lobe-router:module'.

**Canonical URL:** https://skillshunter.net/skills/github-lobehub-lobehub-agents-skills-debug-package-34d9586dcd3a

**JSON URL:** https://skillshunter.net/api/public/v1/skills/github-lobehub-lobehub-agents-skills-debug-package-34d9586dcd3a

**Markdown URL:** https://skillshunter.net/skills/github-lobehub-lobehub-agents-skills-debug-package-34d9586dcd3a.md

**Instructions download URL:** https://skillshunter.net/skills/github-lobehub-lobehub-agents-skills-debug-package-34d9586dcd3a/download

**Category:** Software & Development

**Source URL:** https://github.com/lobehub/lobehub/blob/54382b5c8e81544da454fa6d7b50f461a562c1ee/.agents/skills/debug-package/SKILL.md

**Source commit:** 54382b5c8e81544da454fa6d7b50f461a562c1ee

**Listing approved at:** 2026-11-22

**Created at:** 2026-11-21T11:07:50.000000Z

**Updated at:** 2026-11-22T11:17:05.000000Z

## Catalog information

The following descriptions are catalog information. Listing approval does not mean the skill has been tested or is safe for every environment.

### Editor's note

Ensure the environment is set up with the debug package installed. For browser environments, set `localStorage.debug = 'lobe-*'` to enable logging. In Node.js, use `DEBUG=lobe-*` with your development command. In Electron, set `process.env.DEBUG = 'lobe-*'` before running the application.

### When to use it

- Enable debug logging for server-side modules like 'lobe-server:market'
- Log complex objects with formatted output in client-side applications
- Debug router modules with namespace 'lobe-router:module'

## Skill instructions

---
name: debug-package
description: 'Use for debug() logging, lobe-* namespaces, DEBUG/localStorage.debug configuration and log formatting.'
user-invocable: false
---

# Debug Package Usage Guide

## Basic Usage

```typescript
import debug from 'debug';

// Format: lobe-[module]:[submodule]
const log = debug('lobe-server:market');

log('Simple message');
log('With variable: %O', object);
log('Formatted number: %d', number);
```

## Namespace Conventions

- Desktop: `lobe-desktop:[module]`
- Server: `lobe-server:[module]`
- Client: `lobe-client:[module]`
- Router: `lobe-[type]-router:[module]`

## Format Specifiers

- `%O` - Object expanded (recommended for complex objects)
- `%o` - Object
- `%s` - String
- `%d` - Number

## Enable Debug Output

### Browser

```javascript
localStorage.debug = 'lobe-*';
```

### Node.js

```bash
DEBUG=lobe-* bun run dev
DEBUG=lobe-* pnpm dev
```

### Electron

```typescript
process.env.DEBUG = 'lobe-*';
```

## Example

```typescript
// apps/server/src/routers/lambda/agentEval.ts
import debug from 'debug';

const log = debug('lobe-lambda-router:agent-eval');

log('getAgent input: %O', input);
```

