Skip to content

Commit 6dd711f

Browse files
authored
runners: Elevate some debug logs to info logs (#6933)
This was annoying me when reading through the logs where some of these messages were getting swallowed when I was filtering out debug logs. Hopefully with these as info logs we'll be able to debug things easier. Signed-off-by: Eli Uriegas <[email protected]>
1 parent 073cd99 commit 6dd711f

File tree

1 file changed

+9
-9
lines changed
  • terraform-aws-github-runner/modules/runners/lambdas/runners/src/scale-runners

1 file changed

+9
-9
lines changed

terraform-aws-github-runner/modules/runners/lambdas/runners/src/scale-runners/scale-down.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function scaleDown(): Promise<void> {
4949
);
5050

5151
if (runnersDict.size === 0) {
52-
console.debug(`No active runners found for environment: '${Config.Instance.environment}'`);
52+
console.info(`No active runners found for environment: '${Config.Instance.environment}'`);
5353
return;
5454
}
5555

@@ -345,26 +345,26 @@ export function isRunnerRemovable(
345345
): boolean {
346346
/* istanbul ignore next */
347347
if (ec2runner.instanceManagement?.toLowerCase() === 'pet') {
348-
console.debug(`Runner ${ec2runner.instanceId} is a pet instance and cannot be removed.`);
348+
console.info(`Runner ${ec2runner.instanceId} is a pet instance and cannot be removed.`);
349349
return false;
350350
}
351351

352352
if (ghRunner !== undefined && ghRunner.busy) {
353-
console.debug(`Runner ${ec2runner.instanceId} is busy and cannot be removed.`);
353+
console.info(`Runner ${ec2runner.instanceId} is busy and cannot be removed.`);
354354
return false;
355355
}
356356

357357
if (!runnerMinimumTimeExceeded(ec2runner)) {
358-
console.debug(`Runner ${ec2runner.instanceId} has not exceeded the minimum running time.`);
358+
console.info(`Runner ${ec2runner.instanceId} has not exceeded the minimum running time.`);
359359
metrics.runnerLessMinimumTime(ec2runner);
360360
return false;
361361
}
362362

363363
if (ghRunner === undefined) {
364-
console.debug(`Runner ${ec2runner.instanceId} was not found on GitHub. It might not be running an agent`);
364+
console.info(`Runner ${ec2runner.instanceId} was not found on GitHub. It might not be running an agent`);
365365
}
366366

367-
console.debug(`Runner ${ec2runner.instanceId} is removable.`);
367+
console.info(`Runner ${ec2runner.instanceId} is removable.`);
368368
metrics.runnerIsRemovable(ec2runner);
369369
return true;
370370
}
@@ -405,7 +405,7 @@ export function runnerMinimumTimeExceeded(runner: RunnerInfo): boolean {
405405
const maxTime = moment(new Date()).subtract(Config.Instance.minimumRunningTimeInMinutes, 'minutes').utc();
406406
const minTimeExceeded = baseTime < maxTime;
407407
if (minTimeExceeded) {
408-
console.debug(
408+
console.info(
409409
`[runnerMinimumTimeExceeded] Instance ${runner.instanceId} ${reason} and has ` +
410410
`exceeded the minimum running time of ${Config.Instance.minimumRunningTimeInMinutes} mins ` +
411411
`by ${maxTime.diff(baseTime, 'minutes')} mins.`,
@@ -460,7 +460,7 @@ async function removeRunner(
460460

461461
if (ghRunner !== undefined) {
462462
if (Config.Instance.enableOrganizationRunners) {
463-
console.debug(
463+
console.info(
464464
`GH Runner instance '${ghRunner.id}'[${ec2runner.org}] for EC2 '${ec2runner.instanceId}' ` +
465465
`[${ec2runner.runnerType}] will be removed.`,
466466
);
@@ -484,7 +484,7 @@ async function removeRunner(
484484
}
485485
} else {
486486
const repo = getRepo(ec2runner.repo as string);
487-
console.debug(
487+
console.info(
488488
`GH Runner instance '${ghRunner.id}'[${ec2runner.repo}] for EC2 '${ec2runner.instanceId}' ` +
489489
`[${ec2runner.runnerType}] will be removed.`,
490490
);

0 commit comments

Comments
 (0)