/** * EmailLogger: superset of ChannelLogSink, compatible with SubsystemLogger. * All log methods accept an optional meta object for structured fields. * The optional child() method mirrors SubsystemLogger.child(name). */ export type EmailLogger = { info: (msg: string, meta?: Record) => void; warn: (msg: string, meta?: Record) => void; error: (msg: string, meta?: Record) => void; debug?: (msg: string, meta?: Record) => void; child?: (name: string) => EmailLogger; }; /** * Create an EmailLogger from an optional log sink. * Falls back to console.* if no sink is provided (e.g. in tests or old OpenClaw versions). */ export declare function createEmailLogger(sink?: EmailLogger): EmailLogger; /** * Wrap a logger to inject accountId into every log entry. * * Strategy: * - If the underlying logger supports child() (SubsystemLogger at runtime), * use child(accountId) so the framework adds it as a structured field. * - Otherwise, prepend "[accountId] " to every message string so multi-account * logs are always distinguishable, even in the console fallback path. */ export declare function withAccountId(log: EmailLogger, accountId: string): EmailLogger;