UNPKG

1.25 kBTypeScriptView Raw
1import { HandlerContext } from "@atomist/automation-client/lib/HandlerContext";
2import { WritableLog } from "@atomist/automation-client/lib/util/child_process";
3import { SdmGoalEvent } from "../../api/goal/SdmGoalEvent";
4/**
5 * Log abstraction for output of a specific activity. Not intended as a long-running log
6 * but for a short-lived activity.
7 * Not a technical log of this project but a log of meaningful activity
8 * on behalf of users.
9 */
10export interface ProgressLog extends WritableLog {
11 /**
12 * Name. Should relate to the immediate activity we're logging.
13 */
14 readonly name: string;
15 /**
16 * Return the url of the log if it is persisted
17 */
18 readonly url?: string;
19 flush(): Promise<void>;
20 close(): Promise<void>;
21 /**
22 * Is this logger available at this point in time?
23 * E.g. if it's backed by a service, is that service up?
24 */
25 isAvailable(): Promise<boolean>;
26 /** Function that appends to the log. */
27 write(log: string, ...args: any[]): void;
28}
29/**
30 * Function to create a ProgressLog for a given goal execution
31 */
32export declare type ProgressLogFactory = (context: HandlerContext, sdmGoal: SdmGoalEvent) => Promise<ProgressLog>;
33//# sourceMappingURL=ProgressLog.d.ts.map
\No newline at end of file