ls-deno/log.ts

25 lines
527 B
TypeScript

import { config } from "@/config.ts";
import * as log from "$std/log/mod.ts";
export * as log from "$std/log/mod.ts";
export function setupLoggers() {
log.setup({
handlers: {
console: new log.handlers.ConsoleHandler(config.log.consoleLevelName, {
formatter: `{datetime} {levelName} {msg}`,
}),
},
loggers: {
default: {
level: "DEBUG",
handlers: ["console", "file"],
},
tasks: {
level: "ERROR",
handlers: ["console"],
},
},
});
}