fix broken build

This commit is contained in:
Sebastian 2023-08-23 14:34:01 -03:00
parent ec3ae6f5e3
commit f5596767e1
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
2 changed files with 7 additions and 5 deletions

View File

@ -15,7 +15,7 @@
*/
import {
globalLogLevel,
getGlobalLogLevel,
setGlobalLogLevelFromString,
} from "@gnu-taler/taler-util";
import { TranslationProvider } from "@gnu-taler/web-util/browser";
@ -62,9 +62,7 @@ const App: FunctionalComponent = () => {
);
};
(window as any).setGlobalLogLevelFromString = setGlobalLogLevelFromString;
(window as any).getGlobaLevel = () => {
return globalLogLevel;
};
(window as any).getGlobalLevel = getGlobalLogLevel;
function localStorageProvider(): Map<unknown, unknown> {
const map = new Map(JSON.parse(localStorage.getItem("app-cache") || "[]"));

View File

@ -35,6 +35,10 @@ export enum LogLevel {
let globalLogLevel = LogLevel.Info;
const byTagLogLevel: Record<string, LogLevel> = {};
export function getGlobalLogLevel(): string {
return globalLogLevel;
}
export function setGlobalLogLevelFromString(logLevelStr: string): void {
globalLogLevel = getLevelForString(logLevelStr);
}
@ -98,7 +102,7 @@ function writeNodeLog(
* and uses the corresponding console.* method to log in the browser.
*/
export class Logger {
constructor(private tag: string) {}
constructor(private tag: string) { }
shouldLogTrace(): boolean {
const level = byTagLogLevel[this.tag] ?? globalLogLevel;