Remove redundant debugLog util (#295)

This commit is contained in:
Mateusz Burzyński
2026-02-13 19:13:59 +00:00
committed by pullfrog[bot]
parent 5e76fd86df
commit 3c748ddf6e
2 changed files with 80 additions and 99 deletions
+3 -15
View File
@@ -1,21 +1,9 @@
import { performance } from "node:perf_hooks";
import * as core from "@actions/core";
import { log } from "./log.ts";
export const DEFAULT_ACTIVITY_TIMEOUT_MS = 60_000;
export const DEFAULT_ACTIVITY_CHECK_INTERVAL_MS = 5_000;
// inline debug check — can't import log.ts since activity.ts is a dependency of it
function debugLog(msg: string): void {
const isDebug =
process.env.LOG_LEVEL === "debug" ||
process.env.ACTIONS_STEP_DEBUG === "true" ||
process.env.RUNNER_DEBUG === "1" ||
core.isDebug();
if (isDebug) {
core.info(`[${new Date().toISOString()}] [DEBUG] ${msg}`);
}
}
type ActivityTimeoutContext = {
timeoutMs: number;
checkIntervalMs: number;
@@ -85,11 +73,11 @@ function startProcessOutputMonitor(ctx: OutputMonitorContext): OutputMonitor {
process.stdout.write = wrapWrite(originalStdoutWrite, markActivity);
process.stderr.write = wrapWrite(originalStderrWrite, markActivity);
debugLog(`process activity monitor started: timeout=${ctx.timeoutMs}ms`);
log.debug(`process activity monitor started: timeout=${ctx.timeoutMs}ms`);
const intervalId = setInterval(() => {
const idleMs = getIdleMs();
debugLog(`process activity check: idle=${idleMs}ms / ${ctx.timeoutMs}ms`);
log.debug(`process activity check: idle=${idleMs}ms / ${ctx.timeoutMs}ms`);
if (timedOut || idleMs <= ctx.timeoutMs) return;
timedOut = true;
ctx.onTimeout(idleMs);