This commit is contained in:
vd
2026-10-12 20:38:04 +02:00
parent 18172b4004
commit 4a01f0d7a9
132 changed files with 3809 additions and 4830 deletions
-8
View File
@@ -1,7 +1,6 @@
import { PACKAGE_FILE, STATIC_DIR, WS } from ".";
import Colors from "colors";
import Fs from "fs/promises";
import Path from "path";
import { WebSocketMessage } from "./websocket-handler";
@@ -30,11 +29,6 @@ export function createFileResponse(requestPath: string): Response {
return new Response(Bun.file(fullPath));
}
// OUTPUT
async function writeToLogFile(message: string): Promise<void> {
await Fs.appendFile("logs", `${message}\n`);
}
// stats
export function writeStat(label: string, value: string | number): void {
console.log(
@@ -49,12 +43,10 @@ export function writeSeparator(): void {
// logging
export function writeError(message: any): void {
console.log(Colors.bold.red(message));
writeToLogFile(message);
}
export function writeSuccess(message: string): void {
console.log(Colors.bold.green(message));
writeToLogFile(message);
}
// MESSAGES