lukasa1993/tanstack-skills-extracted/tanstack-ai-core-debug-logging
Claude Code and agent skill by lukasa1993/tanstack-skills-extracted
- community
Checking that the SKILL.md file is still in the repository.
Pluggable, category-toggleable debug logging for TanStack AI activities. Toggle with `debug: true | false | DebugConfig` on chat(), summarize(), generateImage(), generateSpeech(), generateTranscription(), generateVideo(). Categories: request, provider, output, middleware, tools, agentLoop, config, errors. Pipe into pino/winston/etc via `debug: { logger }`. Errors log by default even when `debug` is omitted; silence with `debug: false`.
Install
npx vskill@latest install lukasa1993/tanstack-skills-extracted/tanstack-ai-core-debug-loggingSKILL.md
Debug Logging
Dependency note: This skill builds on ai-core. Read it first for critical rules.
Use this skill when you need to turn debug logging on or off, narrow what's printed, or pipe logs into a custom logger (pino, winston, etc.). The same debug option works on every activity — chat(), summarize(), generateImage(), generateSpeech(), generateTranscription(), generateVideo().
Turn it on
Each log line is prefixed with an emoji and [tanstack-ai:<category>]:
Turn it off
Omitting debug is not the same as debug: false. When omitted, the errors category is still on (errors are cheap and important). Use debug: false or debug: { errors: false } for true silence.
DebugOption — the accepted shapes
Resolution rules for the debug?: DebugOption field on every activity:
debug value | Effect | |
|---|---|---|
omitted (undefined) | Only errors is active; default ConsoleLogger. | |
true | All categories on; default ConsoleLogger. | |
false | All categories off (including errors); default ConsoleLogger. | |
DebugConfig object | Each unspecified flag defaults to true; logger replaces ConsoleLogger. |
Narrow what's printed
Pass a DebugConfig object. Unspecified categories default to true, so it's easiest to toggle by setting specific flags to false:
To print only a specific set, set the rest to false explicitly:
Pipe into your own logger
The default console logger is exported as ConsoleLogger if you want to wrap it:
Categories
| Category | Logs | Applies to | |
|---|---|---|---|
request | Outgoing call to a provider (model, message count, tool count) | All activities | |
provider | Every raw chunk/frame received from a provider SDK | Streaming activities (chat, realtime) | |
output | Every chunk or result yielded to the caller | All activities | |
middleware | Inputs and outputs around every middleware hook | chat() only | |
tools | Before/after tool call execution | chat() only | |
agentLoop | Agent-loop iterations and phase transitions | chat() only | |
config | Config transforms returned by middleware onConfig hooks | chat() only | |
errors | Every caught error anywhere in the pipeline | All activities |
Chat-only categories simply never fire for non-chat activities — those concepts don't exist in their pipelines.
Non-chat activities
Same debug option everywhere:
Realtime session adapters in provider packages (e.g. openaiRealtime, elevenlabsRealtime) accept the same debug?: DebugOption on their session options. They emit request, provider, and errors lines; the chat-only categories don't apply.
Common Mistakes
a. HIGH: Treating omitted debug as silent
debug undefined means "only errors"; debug: false means "nothing at all".
Source: docs/advanced/debug-logging.md
b. MEDIUM: Reaching for middleware when debug would do
For observing the built-in pipeline, the debug option is strictly faster than writing logging middleware. Reach for middleware when you need to _transform_ chunks, not just see them.
Source: docs/advanced/debug-logging.md
c. LOW: Logger implementation that can throw
A user-supplied Logger that throws will have its exception swallowed by the SDK so it never masks the real error that triggered the log call. Still, prefer implementations that don't throw — silenced exceptions are harder to debug than loud ones.
Source: packages/ai/src/logger/internal-logger.ts
Cross-References
- See also: ../tanstack-ai-core-middleware/SKILL.md — if you need to transform
chunks/config, not just observe them.
- See also: Observability (
docs/advanced/observability.md) — the
programmatic event client for a richer, structured feed beyond log lines.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/tanstack-ai-core-debug-logging/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lukasa1993/tanstack-skills-extracted/tanstack-ai-core-debug-logging)