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

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

No files matched your search

+5 -2
View File
@@ -2,7 +2,10 @@ import { fetch } from "undici";
import { extractErrorMessage } from "@homarr/common";
import { LoggingAgent } from "@homarr/common/server";
import { logger } from "@homarr/log";
import { createLogger } from "@homarr/core/infrastructure/logs";
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
const logger = createLogger({ module: "ping" });
export const sendPingRequestAsync = async (url: string) => {
try {
@@ -29,7 +32,7 @@ export const sendPingRequestAsync = async (url: string) => {
return { statusCode: response.status, durationMs };
});
} catch (error) {
logger.error(new Error(`Failed to send ping request to "${url}"`, { cause: error }));
logger.error(new ErrorWithMetadata("Failed to send ping request", { url }, { cause: error }));
return {
error: extractErrorMessage(error),
};