1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const automation_client_1 = require("@atomist/automation-client");
|
19 | const EphemeralProgressLog_1 = require("@atomist/sdm/api-helper/log/EphemeralProgressLog");
|
20 | const firstAvailableProgressLog_1 = require("@atomist/sdm/api-helper/log/firstAvailableProgressLog");
|
21 | const LoggingProgressLog_1 = require("@atomist/sdm/api-helper/log/LoggingProgressLog");
|
22 | const WriteToAllProgressLog_1 = require("@atomist/sdm/api-helper/log/WriteToAllProgressLog");
|
23 | const DashboardDisplayProgressLog_1 = require("./DashboardDisplayProgressLog");
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | function rolarAndDashboardLogFactory(rolarBaseUrl, bufferSize = 1000, flushInterval = 2000) {
|
32 | let persistentLogFactory = (context, sdmGoal, fallback) => firstAvailableProgressLog_1.firstAvailableProgressLog(fallback);
|
33 | if (rolarBaseUrl) {
|
34 | automation_client_1.logger.info("Logging with Rolar: " + rolarBaseUrl);
|
35 | persistentLogFactory = (context, sdmGoal, fallback) => {
|
36 | return firstAvailableProgressLog_1.firstAvailableProgressLog(new DashboardDisplayProgressLog_1.DashboardDisplayProgressLog(rolarBaseUrl, bufferSize, flushInterval, context, sdmGoal), fallback);
|
37 | };
|
38 | }
|
39 | return async (context, sdmGoal) => {
|
40 | const name = sdmGoal.name;
|
41 | const persistentLog = await persistentLogFactory(context, sdmGoal, new LoggingProgressLog_1.LoggingProgressLog(name, "info"));
|
42 | return new WriteToAllProgressLog_1.WriteToAllProgressLog(name, await EphemeralProgressLog_1.createEphemeralProgressLog(context, sdmGoal), persistentLog);
|
43 | };
|
44 | }
|
45 | exports.rolarAndDashboardLogFactory = rolarAndDashboardLogFactory;
|
46 |
|
\ | No newline at end of file |