refactor: use console.info for log consistency and clean up deprecated code

This commit is contained in:
2026-04-17 19:16:13 +02:00
parent 3b074977ed
commit 542a99d23a
6 changed files with 7 additions and 23 deletions

View File

@@ -32,7 +32,7 @@ export async function handleAggregation(env: Env): Promise<void> {
await deleteOldRawData(env.DB, now);
await deleteOldHourlyData(env.DB, now);
console.warn(
console.info(
JSON.stringify({
event: 'aggregation_complete',
hour: new Date(hourStart * 1000).toISOString(),

View File

@@ -131,7 +131,7 @@ const worker = {
})
);
console.warn(
console.info(
JSON.stringify({
event: 'scheduled_complete',
checks: checks.length,
@@ -161,7 +161,7 @@ async function executeCheck(check: CheckRequest, env: Env): Promise<CheckResult>
// If region is specified and we have Durable Object binding, run check from that region
if (check.region && env.REGIONAL_CHECKER_DO) {
try {
console.warn(
console.info(
JSON.stringify({ event: 'regional_check_start', monitor: check.name, region: check.region })
);
@@ -186,7 +186,7 @@ async function executeCheck(check: CheckRequest, env: Env): Promise<CheckResult>
// Ignore kill errors - Durable Object will be garbage collected
}
console.warn(
console.info(
JSON.stringify({
event: 'regional_check_complete',
monitor: check.name,
@@ -216,7 +216,7 @@ async function executeCheck(check: CheckRequest, env: Env): Promise<CheckResult>
}
async function executeLocalCheck(check: CheckRequest): Promise<CheckResult> {
console.warn(JSON.stringify({ event: 'local_check_start', monitor: check.name }));
console.info(JSON.stringify({ event: 'local_check_start', monitor: check.name }));
switch (check.type) {
case 'http': {
return executeHttpCheck(check);

View File

@@ -1,2 +0,0 @@
// Temporary import for next edit
import { isInMaintenance } from '../utils/maintenance.js';

View File

@@ -6,7 +6,7 @@ import type { CheckRequest, CheckResult } from '../types.js';
export class RegionalChecker extends DurableObject {
async runCheck(check: CheckRequest): Promise<CheckResult> {
console.warn(JSON.stringify({ event: 'regional_check_run', monitor: check.name }));
console.info(JSON.stringify({ event: 'regional_check_run', monitor: check.name }));
try {
// Execute the check locally in this Durable Object's region