mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Add other thing to logger
This commit is contained in:
parent
985190c683
commit
80d592de48
1 changed files with 2 additions and 2 deletions
|
|
@ -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 &&
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue