refactor(api): 🔊 Move HTTP logs to logtape/hono
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 1s
Build Docker Images / lint (push) Failing after 7s
Build Docker Images / check (push) Failing after 6s
Build Docker Images / tests (push) Failing after 6s
Build Docker Images / detect-circular (push) Failing after 6s
Deploy Docs to GitHub Pages / build (push) Failing after 0s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Mirror to Codeberg / Mirror (push) Failing after 0s
Nix Build / check (push) Failing after 1s
Test Publish / build (client) (push) Failing after 0s
Test Publish / build (sdk) (push) Failing after 0s

This commit is contained in:
Jesse Wierzbinski 2025-12-18 22:22:03 +01:00
parent a2d7c323f6
commit de69f27877
No known key found for this signature in database
9 changed files with 15 additions and 50 deletions

View file

@ -1,9 +1,7 @@
import type { Hook } from "@hono/standard-validator";
import type { RolePermission } from "@versia/client/schemas";
import { config } from "@versia-server/config";
import { serverLogger } from "@versia-server/logging";
import { extractParams, verifySolution } from "altcha-lib";
import chalk from "chalk";
import { eq, type SQL } from "drizzle-orm";
import type { Context, Hono, MiddlewareHandler, ValidationTargets } from "hono";
import { every } from "hono/combine";
@ -417,19 +415,3 @@ export const jsonOrForm = (): MiddlewareHandler<HonoEnv> => {
await next();
});
};
export const debugResponse = async (res: Response): Promise<void> => {
const body = await res.clone().text();
const status = `${chalk.bold("Status")}: ${chalk.green(res.status)}`;
const headers = `${chalk.bold("Headers")}:\n${Array.from(
res.headers.entries(),
)
.map(([key, value]) => ` - ${chalk.cyan(key)}: ${chalk.white(value)}`)
.join("\n")}`;
const bodyLog = `${chalk.bold("Body")}: ${chalk.gray(body)}`;
serverLogger.debug`${status}\n${headers}\n${bodyLog}`;
};