refactor(backend): split log files into separate file
This commit is contained in:
14
lib/log/constants.ts
Normal file
14
lib/log/constants.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as env from "@lib/env.ts";
|
||||
import { ensureDir } from "https://deno.land/std@0.224.0/fs/mod.ts";
|
||||
import { join } from "node:path";
|
||||
import { getLogLevel, LOG_LEVEL } from "@lib/log/types.ts";
|
||||
|
||||
export const LOG_DIR = join(env.DATA_DIR, "logs");
|
||||
|
||||
// Ensure the log directory exists
|
||||
await ensureDir(LOG_DIR);
|
||||
|
||||
export let logLevel = getLogLevel(env.LOG_LEVEL);
|
||||
export function setLogLevel(level: LOG_LEVEL) {
|
||||
logLevel = level;
|
||||
}
|
||||
Reference in New Issue
Block a user