Skip to content

Proposal: Extend koad:io Logger for AI-Interactive Development #84

@koad

Description

@koad

Problem

When developing with AI agents (like Vulcan), there's no structured way to:

  1. Capture development session logs for later review
  2. Stream logs in real-time to another AI agent for live debugging
  3. Search/query past development sessions

Solution

Extend ~/.koad-io/packages/core/server/logger.js to write a parallel log file when in development mode.

Implementation Sketch

// In logger.js, add development-mode file logging
const isDev = !Meteor.isProduction && process.env.KOAD_DEV_LOGS === 'true';

if (isDev) {
  const fs = Npm.require('fs');
  const path = Npm.require('path');
  const logFile = path.join(process.cwd(), `dev-session-${Date.now()}.log`);
  
  // Wrap logger methods to also write to file
  const originalInfo = logger.info.bind(logger);
  logger.info = function(...args) {
    originalInfo(...args);
    fs.appendFileSync(logFile, `[\${new Date().toISOString()}] INFO: \${args.join(' ')}\n`);
  };
  // ... same for warn, error, debug
}

Features This Enables

Feature Use Case
Session replay Review what happened in a dev session
Live streaming tail -f dev-session-*.log in another terminal for real-time debugging
Pattern detection Search logs across sessions for recurring issues
Agent memory Feed logs to playback-machine for context on past issues

Simple Env Toggle

KOAD_DEV_LOGS=true enables it, off by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions