Add logging with Winston

This commit is contained in:
Hannah dagemark 2026-09-15 11:34:39 +02:00
commit 9293c92e58
8 changed files with 357 additions and 25 deletions

View file

@ -1,5 +1,7 @@
import { RequestInit } from "next/dist/server/web/spec-extension/request";
import logger from "../logging/logger";
const FRONTEND_URL = process.env.NEXT_PUBLIC_FRONTEND_URL;
export async function cmFetch<T>(
@ -25,7 +27,7 @@ export async function cmFetchRaw(
if (!response.ok && !ignoreStatuses?.includes(response.status)) {
throw new Error("Request failed");
}
console.log(response);
logger.log("debug", response); // debug: cmFetch response logging
return response;
}