mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Add more debug logging
This commit is contained in:
parent
8939d17b8a
commit
8da0f55869
|
|
@ -104,7 +104,7 @@ export class LogManager {
|
||||||
private async write(text: string) {
|
private async write(text: string) {
|
||||||
Bun.stdout.name;
|
Bun.stdout.name;
|
||||||
if (this.output === Bun.stdout) {
|
if (this.output === Bun.stdout) {
|
||||||
await Bun.write(Bun.stdout, `${text}\n`);
|
await console.log(`${text}`);
|
||||||
} else {
|
} else {
|
||||||
if (!(await exists(this.output.name ?? ""))) {
|
if (!(await exists(this.output.name ?? ""))) {
|
||||||
// Create file if it doesn't exist
|
// Create file if it doesn't exist
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { dualLogger } from "@loggers";
|
||||||
import { errorResponse, jsonResponse, response } from "@response";
|
import { errorResponse, jsonResponse, response } from "@response";
|
||||||
import type { MatchedRoute } from "bun";
|
import type { MatchedRoute } from "bun";
|
||||||
import { type Config, config } from "config-manager";
|
import { type Config, config } from "config-manager";
|
||||||
|
|
@ -83,6 +84,12 @@ export const processRoute = async (
|
||||||
matchedRoute.filePath
|
matchedRoute.filePath
|
||||||
).catch(() => null);
|
).catch(() => null);
|
||||||
|
|
||||||
|
await dualLogger.log(
|
||||||
|
LogLevel.DEBUG,
|
||||||
|
"Server.RouteProcessor",
|
||||||
|
JSON.stringify(route),
|
||||||
|
);
|
||||||
|
|
||||||
if (!route) {
|
if (!route) {
|
||||||
return errorResponse("Route not found", 404);
|
return errorResponse("Route not found", 404);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue