Add more debug logging

This commit is contained in:
Jesse Wierzbinski 2024-04-14 01:44:17 -10:00
parent 8939d17b8a
commit 8da0f55869
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

View file

@ -104,7 +104,7 @@ export class LogManager {
private async write(text: string) {
Bun.stdout.name;
if (this.output === Bun.stdout) {
await Bun.write(Bun.stdout, `${text}\n`);
await console.log(`${text}`);
} else {
if (!(await exists(this.output.name ?? ""))) {
// Create file if it doesn't exist

View file

@ -1,3 +1,4 @@
import { dualLogger } from "@loggers";
import { errorResponse, jsonResponse, response } from "@response";
import type { MatchedRoute } from "bun";
import { type Config, config } from "config-manager";
@ -83,6 +84,12 @@ export const processRoute = async (
matchedRoute.filePath
).catch(() => null);
await dualLogger.log(
LogLevel.DEBUG,
"Server.RouteProcessor",
JSON.stringify(route),
);
if (!route) {
return errorResponse("Route not found", 404);
}