Add other thing to logger

This commit is contained in:
Jesse Wierzbinski 2024-04-09 20:51:09 -10:00
parent 985190c683
commit 80d592de48
No known key found for this signature in database

View file

@ -96,7 +96,7 @@ export class LogManager {
if (content_type?.includes("application/json")) { if (content_type?.includes("application/json")) {
try { try {
const json = await req.json(); const json = await req.clone().json();
const stringified = JSON.stringify(json, null, 4) const stringified = JSON.stringify(json, null, 4)
.split("\n") .split("\n")
.map((line) => ` ${line}`) .map((line) => ` ${line}`)
@ -104,7 +104,7 @@ export class LogManager {
string += `${stringified}\n`; string += `${stringified}\n`;
} catch { } catch {
string += " [Invalid JSON]\n"; string += ` [Invalid JSON] (raw: ${await req.text()})\n`;
} }
} else if ( } else if (
content_type && content_type &&