/** * src/core/Logger.ts * * First-class logging built on the existing trace infrastructure: log entries * are TraceEnvelopes discriminated by `entryType: 'log'` and persisted to the * same NDJSON store (`.agenthood/traces/traces.ndjson`) that the Tracer and * RetentionManager already own. Zero new runtime dependencies. * * Existing `console.*` calls are untouched — `log()` is the recommended * replacement, not a hard migration. */ import { RedactionFilter } from './RedactionFilter.ts'; import type { TraceSource, LogLevel } from './types.ts'; import type { RunEventBus } from './RunEventBus.ts'; export interface LoggerOptions { /** Project root; defaults to process.cwd(). */ projectPath?: string; /** Parsed config; defaults to the project's `.agenthood/config.json`. */ config?: Record; source?: TraceSource; /** Correlation id attached to every entry; a new one is generated per Logger. */ correlationId?: string; /** Optional live bus — emits `log.created` when provided. */ events?: RunEventBus; /** Overrides the redactor derived from config (test seam, explicit policy). */ redactor?: RedactionFilter; } export interface AgenthoodLogger { log(level: LogLevel, message: string, member?: string, metadata?: Record): Promise; debug(message: string, member?: string, metadata?: Record): Promise; info(message: string, member?: string, metadata?: Record): Promise; warn(message: string, member?: string, metadata?: Record): Promise; error(message: string, member?: string, metadata?: Record): Promise; } /** * Appends a log entry as a TraceEnvelope to the shared NDJSON store. * Non-fatal: a persistence failure is reported to the console but never * throws, so logging can never break the caller. */ export declare class Logger implements AgenthoodLogger { private readonly filePath; private readonly source; private readonly correlationId; private readonly events?; private readonly redactor; constructor(options?: LoggerOptions); log(level: LogLevel, message: string, member?: string, metadata?: Record): Promise; debug(message: string, member?: string, metadata?: Record): Promise; info(message: string, member?: string, metadata?: Record): Promise; warn(message: string, member?: string, metadata?: Record): Promise; error(message: string, member?: string, metadata?: Record): Promise; } //# sourceMappingURL=Logger.d.ts.map