ai-core/debug-logging

Configure category-toggleable debug logging for TanStack AI activities.

3.1k|316|Updated Oct 8, 2025
One-click install
npx skills add https://github.com/TanStack/ai --skill ai-core-debug-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-core/debug-logging
Source: https://github.com/TanStack/ai/tree/main/packages/ai/skills/ai-core/debug-logging
Command: npx skills add https://github.com/TanStack/ai --skill ai-core-debug-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When building AI applications with TanStack AI, it is hard to see what happens inside the pipeline — what requests go to providers, which chunks stream back, how tools and middleware behave, and where errors occur. This Skill provides a single debug option that turns on structured, category-tagged logging across every activity without writing custom instrumentation.

Core Features & Use Cases

  • Unified debug option: Pass debug: true | false | DebugConfig to chat(), summarize(), generateImage(), generateSpeech(), generateTranscription(), and generateVideo().
  • Per-category toggles: Enable or silence eight categories — request, provider, output, middleware, tools, agentLoop, config, and errors — with unspecified flags defaulting to true.
  • Custom logger integration: Pipe logs into pino, winston, or any logger implementing the Logger interface via debug: { logger }.
  • Use Case: While debugging a streaming chat agent, enable only the provider and output categories to trace raw provider chunks and emitted output without noise from middleware or agent-loop logs.

Quick Start

Enable debug logging on a chat call by setting the debug option to true and ask the assistant to show the categorized log output.

Frequently Asked Questions about ai-core/debug-logging

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

FAQPage Schema
How do I enable debug logging in TanStack AI chat?

Pass debug: true to the chat() options to enable all log categories printed to the console. Each line is prefixed with an emoji and a [tanstack-ai:<category>] tag so you can filter output by pipeline stage.

How do I pipe TanStack AI logs into pino or winston?

Implement the Logger interface with debug, info, warn, and error methods that forward to your logger, then pass it via debug: { logger }. All categories stay enabled while output routes through your custom logger instead of the default ConsoleLogger.

Does TanStack AI log errors when debug is not set?

Yes. When the debug option is omitted, the errors category remains active by default, so failures still print via [tanstack-ai:errors]. Use debug: false or debug: { errors: false } for complete silence.

Can I enable only specific debug log categories?

Yes. Pass a DebugConfig object and set unwanted categories to false, since unspecified flags default to true. For example, debug: { middleware: false } logs everything except middleware activity.

Which debug categories apply to non-chat activities like generateImage?

Non-chat activities such as summarize, generateImage, generateSpeech, generateTranscription, and generateVideo emit request, provider, output, and errors logs. Chat-only categories like middleware, tools, agentLoop, and config never fire for those pipelines.