Add logging with Winston
This commit is contained in:
parent
e40ed22746
commit
9293c92e58
8 changed files with 357 additions and 25 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue