refactor(logs): move to core package (#4586)

This commit is contained in:
Meier Lukas
2025-12-16 23:37:44 +01:00
committed by GitHub
parent d86af072bf
commit d348abfe4a
145 changed files with 971 additions and 708 deletions

View File

@@ -2,7 +2,7 @@ import type { Proxmox } from "proxmox-api";
import proxmoxApi from "proxmox-api";
import { fetchWithTrustedCertificatesAsync } from "@homarr/certificates/server";
import { logger } from "@homarr/log";
import { createLogger } from "@homarr/core/infrastructure/logs";
import { HandleIntegrationErrors } from "../base/errors/decorator";
import type { IntegrationTestingInput } from "../base/integration";
@@ -19,6 +19,8 @@ import type {
StorageResource,
} from "./proxmox-types";
const logger = createLogger({ module: "proxmoxIntegration" });
@HandleIntegrationErrors([new ProxmoxApiErrorHandler()])
export class ProxmoxIntegration extends Integration implements IClusterHealthMonitoringIntegration {
protected async testingAsync(input: IntegrationTestingInput): Promise<TestingResult> {
@@ -31,9 +33,13 @@ export class ProxmoxIntegration extends Integration implements IClusterHealthMon
const proxmox = this.getPromoxApi();
const resources = await proxmox.cluster.resources.$get();
logger.info(
`Found ${resources.length} resources in Proxmox cluster node=${resources.filter((resource) => resource.type === "node").length} lxc=${resources.filter((resource) => resource.type === "lxc").length} qemu=${resources.filter((resource) => resource.type === "qemu").length} storage=${resources.filter((resource) => resource.type === "storage").length}`,
);
logger.info("Found resources in Proxmox cluster", {
total: resources.length,
node: resources.filter((resource) => resource.type === "node").length,
lxc: resources.filter((resource) => resource.type === "lxc").length,
qemu: resources.filter((resource) => resource.type === "qemu").length,
storage: resources.filter((resource) => resource.type === "storage").length,
});
const mappedResources = resources.map(mapResource).filter((resource) => resource !== null);
return {