Skip to content

Debug Console

The Debug Console is a built-in bottom panel tab that shows structured, timestamped log entries from anywhere in the renderer. It shipped in issue #18.

Open it with ⌘J (or the status bar toggle), then click the Debug Console tab.

Writing to the Console

ts
import { debugConsole } from '@openconduit/core';

debugConsole.debug('noisy internal event', { delta: '...' });
debugConsole.log('settings loaded', { provider: 'openai' });
debugConsole.info('routing decision', { original: 'gpt-4o', final: 'gpt-4o-mini' });
debugConsole.warn('rate limit approaching', { remaining: 3 });
debugConsole.error('stream failed', err);

debugConsole is a plain object — it can be called from any renderer module, store, hook, or component. It is not available in the main process.

Log Levels

MethodLevelDefault visible?Color
.debug()debugNo (hidden at info default)dim grey
.log()logNo (hidden at info default)grey
.info()infoYesblue
.warn()warnYesyellow
.error()errorYesred

The filter in the toolbar is a minimum level selector — choosing INFO shows info, warn, and error. The default is info.

Built-in Events

The following events are logged automatically by the core:

EventLevelData
Settings loadedlogdefaultProvider, defaultModel, providerCount
MCP status refreshdebugtotal, connected
Stream starteddebugmessageId, conversationId, model, providerId
Stream endeddebugmessageId, conversationId, usage
Stream errorerrormessageId, conversationId, error
Tool calls pending approvalinfomessageId, tools[]
Tool approval requestedinfomessageId, toolName, toolId
Tool approval responseinfotoolId, approved
Routing decisioninfooriginal, final, reason
Routing failure (non-fatal)warnerror

UI Features

  • Level filter — minimum-level selector (ALL / DBG / LOG / INFO / WARN / ERROR)
  • Auto-scroll — checkbox to keep the view pinned to the latest entry
  • Entry count — shows how many entries pass the current filter
  • Clear — empties the ring buffer (max 500 entries)
  • Data preview — inline JSON for short payloads; expandable show data link for long ones

useDebugConsoleStore

The underlying Zustand store is exported for advanced use:

ts
import { useDebugConsoleStore } from '@openconduit/core';

const { entries, addEntry, clear } = useDebugConsoleStore();

// Add an entry directly
addEntry('warn', 'something odd', { detail: 123 });

Types

ts
type DebugLevel = 'debug' | 'log' | 'info' | 'warn' | 'error';

interface DebugEntry {
  id: string;
  ts: number;       // Date.now()
  level: DebugLevel;
  message: string;
  data?: unknown;   // serialized as JSON in the UI
}

Released under the AGPLv3 License.