mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
refactor console imports, added config update event
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { $console } from "core";
|
||||
import { $console } from "./console";
|
||||
|
||||
type ConsoleSeverity = "log" | "warn" | "error";
|
||||
const _oldConsoles = {
|
||||
@@ -36,14 +36,14 @@ export function disableConsoleLog(severities: ConsoleSeverity[] = ["log", "warn"
|
||||
severities.forEach((severity) => {
|
||||
console[severity] = () => null;
|
||||
});
|
||||
$console.setLevel("critical");
|
||||
$console?.setLevel("critical");
|
||||
}
|
||||
|
||||
export function enableConsoleLog() {
|
||||
Object.entries(_oldConsoles).forEach(([severity, fn]) => {
|
||||
console[severity as ConsoleSeverity] = fn;
|
||||
});
|
||||
$console.resetLevel();
|
||||
$console?.resetLevel();
|
||||
}
|
||||
|
||||
export function formatMemoryUsage() {
|
||||
|
||||
Reference in New Issue
Block a user