tidaldb/.sdlc/tools/_shared/log.ts
jordan 5ceef74f3b chore: bootstrap SDLC state machine for tidalDB
- Initialize .sdlc/ with config, guidance, and state machine
- Register M0-M8 as released milestones (full engine track history)
- Seed M9 (Community Sync & Revocation) and M10 (Governance & Agent Rights) with features
- Seed product milestones P0-P4 and PG1 gate with features from existing planning docs
- Add Team section to AGENTS.md (tidal-engineer, tidal-visionary, tidal-researcher, tidal-storyteller)
- Add knowledge-librarian agent for .sdlc/knowledge/ curation
- Gitignore .sdlc/telemetry.redb (volatile binary state)
- Add .ai/ scaffold (project knowledge index)
2026-03-03 00:41:41 -07:00

26 lines
856 B
TypeScript

/**
* Standard SDLC Tool Logger
*
* Writes structured log lines to STDERR (never stdout — stdout is reserved
* for JSON output). Use this in every tool to produce consistent, parseable logs.
*
* Format: [sdlc-tool:<name>] LEVEL: message
* Example: [sdlc-tool:ama] INFO: Indexed 312 files in 842ms
*
* Set SDLC_TOOL_DEBUG=1 to enable debug-level output.
*/
export function makeLogger(toolName: string) {
const prefix = `[sdlc-tool:${toolName}]`
return {
info: (msg: string) => console.error(`${prefix} INFO: ${msg}`),
warn: (msg: string) => console.error(`${prefix} WARN: ${msg}`),
error: (msg: string) => console.error(`${prefix} ERROR: ${msg}`),
debug: (msg: string) => {
if (process.env.SDLC_TOOL_DEBUG) console.error(`${prefix} DEBUG: ${msg}`)
},
}
}
export type Logger = ReturnType<typeof makeLogger>