Interface HookReporter
interface HookReporter {
error<T>(message: string, data?: T & AsValue<T>): Promise<void>;
info<T>(message: string, data?: T & AsValue<T>): Promise<void>;
setGlobalMetadata<T>(key: string, value: T & AsValue<T>): Promise<void>;
warning<T>(message: string, data?: T & AsValue<T>): Promise<void>;
}
error<T>(message: string, data?: T & AsValue<T>): Promise<void>;
info<T>(message: string, data?: T & AsValue<T>): Promise<void>;
setGlobalMetadata<T>(key: string, value: T & AsValue<T>): Promise<void>;
warning<T>(message: string, data?: T & AsValue<T>): Promise<void>;
}
What a hook reports through during one call: its own events,
journey_info,journey_warningandjourney_error, each with a message and, optionally, data, and global metadata. Each event names the policy and the hook, and, for a step hook, the step and its attempt. itinera makes one for each call and closes it when the call ends.Each call settles once every reporter has been given what it reports, so await it; itinera keeps the order of calls a hook does not await.