Skip to content

Commit 879f4f5

Browse files
committed
Dump the entire log in debug
1 parent e410971 commit 879f4f5

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

dist/index.js

+8-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import * as fs from 'node:fs/promises';
44
import * as os from 'node:os';
55
import * as path from 'node:path';
66
import { spawn } from 'node:child_process';
7-
import { createWriteStream, openSync, writeSync, close } from 'node:fs';
7+
import { createWriteStream, openSync, writeSync, close, readFileSync } from 'node:fs';
88
import { pipeline } from 'node:stream/promises';
9-
import { setTimeout } from 'timers/promises';
109
import { inspect } from 'node:util';
1110

1211
import * as core from '@actions/core';
@@ -187,7 +186,6 @@ async function tearDownAutoCache() {
187186
const log = new Tail(path.join(daemonDir, 'daemon.log'));
188187
core.debug(`tailing daemon.log...`);
189188
log.on('line', (line) => {
190-
core.debug(`got a log line`);
191189
core.info(line);
192190
});
193191

@@ -198,8 +196,6 @@ async function tearDownAutoCache() {
198196
core.debug(`back from post`);
199197
core.debug(res);
200198
} finally {
201-
await setTimeout(5000);
202-
203199
core.debug(`unwatching the daemon log`);
204200
log.unwatch();
205201
}
@@ -211,6 +207,12 @@ async function tearDownAutoCache() {
211207
if (e.code !== 'ESRCH') {
212208
throw e;
213209
}
210+
} finally {
211+
if (core.isDebug()) {
212+
core.info("Entire log:");
213+
const log = readFileSync(path.join(daemonDir, 'daemon.log'));
214+
core.info(log.toString());
215+
}
214216
}
215217
}
216218

0 commit comments

Comments
 (0)