ls-deno/log.ts

25 lines
527 B
TypeScript
Raw Normal View History

2022-10-11 23:49:36 -05:00
import { config } from "@/config.ts";
2022-10-11 12:20:25 -05:00
import * as log from "$std/log/mod.ts";
2022-10-11 16:17:21 -05:00
export * as log from "$std/log/mod.ts";
2022-10-11 12:20:25 -05:00
export function setupLoggers() {
log.setup({
handlers: {
2022-10-11 23:49:36 -05:00
console: new log.handlers.ConsoleHandler(config.log.consoleLevelName, {
2022-10-11 12:20:25 -05:00
formatter: `{datetime} {levelName} {msg}`,
}),
},
loggers: {
default: {
level: "DEBUG",
handlers: ["console", "file"],
},
tasks: {
level: "ERROR",
handlers: ["console"],
},
},
});
}