/** * Structured logger for Shogo runtime services. * * Outputs JSON lines in production / staging (suitable for SigNoz log * collection or any structured log pipeline) and a human-readable * `[service] msg {extra}` format in development. * * Lifted into the SDK from `@shogo/shared-runtime` (was AGPL) under MIT * so userland agent/app code can import the same logger the runtime * services use without dragging an AGPL workspace dependency. * * @example * import { createLogger } from '@shogo-ai/sdk/logger' * * const log = createLogger('my-service') * log.info('boot complete', { port: 8002 }) * * const reqLog = log.child({ requestId: 'r-123' }) * reqLog.warn('slow query', { ms: 4200 }) */ type LogLevel = 'debug' | 'info' | 'warn' | 'error'; interface Logger { debug(msg: string, extra?: Record): void; info(msg: string, extra?: Record): void; warn(msg: string, extra?: Record): void; error(msg: string, extra?: Record): void; /** Returns a new logger that merges `extra` into every log entry. */ child(extra: Record): Logger; } declare function createLogger(service: string, defaultExtra?: Record): Logger; export { type LogLevel, type Logger, createLogger };