feat: refactor whole bunch of stuff
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import * as env from "@lib/env.ts";
|
||||
import { ensureDir } from "fs";
|
||||
import { join } from "node:path";
|
||||
import { getLogLevel, LOG_LEVEL } from "@lib/log/types.ts";
|
||||
import { mkdir } from "node:fs/promises";
|
||||
|
||||
export const LOG_DIR = join(env.DATA_DIR, "logs");
|
||||
|
||||
// Ensure the log directory exists
|
||||
await ensureDir(LOG_DIR);
|
||||
await mkdir(LOG_DIR, { recursive: true });
|
||||
|
||||
export let logLevel = getLogLevel(env.LOG_LEVEL);
|
||||
export function setLogLevel(level: LOG_LEVEL) {
|
||||
|
||||
Reference in New Issue
Block a user