Skip to content

Commit

Permalink
Dump the entire log in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Dec 5, 2023
1 parent e410971 commit 879f4f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
12 changes: 8 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import * as fs from 'node:fs/promises';
import * as os from 'node:os';
import * as path from 'node:path';
import { spawn } from 'node:child_process';
import { createWriteStream, openSync, writeSync, close } from 'node:fs';
import { createWriteStream, openSync, writeSync, close, readFileSync } from 'node:fs';
import { pipeline } from 'node:stream/promises';
import { setTimeout } from 'timers/promises';
import { inspect } from 'node:util';

import * as core from '@actions/core';
Expand Down Expand Up @@ -187,7 +186,6 @@ async function tearDownAutoCache() {
const log = new Tail(path.join(daemonDir, 'daemon.log'));
core.debug(`tailing daemon.log...`);
log.on('line', (line) => {
core.debug(`got a log line`);
core.info(line);
});

Expand All @@ -198,8 +196,6 @@ async function tearDownAutoCache() {
core.debug(`back from post`);
core.debug(res);
} finally {
await setTimeout(5000);

core.debug(`unwatching the daemon log`);
log.unwatch();
}
Expand All @@ -211,6 +207,12 @@ async function tearDownAutoCache() {
if (e.code !== 'ESRCH') {
throw e;
}
} finally {
if (core.isDebug()) {
core.info("Entire log:");
const log = readFileSync(path.join(daemonDir, 'daemon.log'));
core.info(log.toString());
}
}
}

Expand Down

0 comments on commit 879f4f5

Please sign in to comment.