log level prop

This commit is contained in:
2024-05-19 16:01:08 +02:00
parent c1778b3d49
commit 3a3711b713

View File

@@ -2,7 +2,7 @@ import log from "loglevel";
import { apply, reg } from "loglevel-plugin-prefix"; import { apply, reg } from "loglevel-plugin-prefix";
export function initLogger() { export function initLogger() {
log.setLevel(process.env.NODE_ENV === 'production' ? 'info' : 'trace'); log.setLevel(import.meta.env.VITE_LOG_LEVEL ?? 'info');
reg(log); reg(log);
apply(log, {template: '[%t] %l:'}); apply(log, {template: '[%t] %l:'});
} }