1.0.1
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user