From 9e39f4b504aded567cfd588accd6bb0a1b7d97b0 Mon Sep 17 00:00:00 2001 From: AbdulrhmanGoni Date: Sun, 19 Jan 2025 19:35:25 +0300 Subject: [PATCH] fix: create `logs` directory if it is not existing --- src/services/logger/logger_service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/services/logger/logger_service.ts b/src/services/logger/logger_service.ts index da63c9f..38bedd5 100644 --- a/src/services/logger/logger_service.ts +++ b/src/services/logger/logger_service.ts @@ -1,6 +1,13 @@ +import { mkdirSync } from "node:fs"; import { appendFile } from "node:fs/promises"; import type { LogDetails } from "../../types/logging"; +try { + mkdirSync("logs") +} catch { + // +} + export default async function logger_service(log: LogDetails) { const timestamp = new Date().toISOString(); if (