fix broken build
This commit is contained in:
parent
ec3ae6f5e3
commit
f5596767e1
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
globalLogLevel,
|
getGlobalLogLevel,
|
||||||
setGlobalLogLevelFromString,
|
setGlobalLogLevelFromString,
|
||||||
} from "@gnu-taler/taler-util";
|
} from "@gnu-taler/taler-util";
|
||||||
import { TranslationProvider } from "@gnu-taler/web-util/browser";
|
import { TranslationProvider } from "@gnu-taler/web-util/browser";
|
||||||
@ -62,9 +62,7 @@ const App: FunctionalComponent = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
(window as any).setGlobalLogLevelFromString = setGlobalLogLevelFromString;
|
(window as any).setGlobalLogLevelFromString = setGlobalLogLevelFromString;
|
||||||
(window as any).getGlobaLevel = () => {
|
(window as any).getGlobalLevel = getGlobalLogLevel;
|
||||||
return globalLogLevel;
|
|
||||||
};
|
|
||||||
|
|
||||||
function localStorageProvider(): Map<unknown, unknown> {
|
function localStorageProvider(): Map<unknown, unknown> {
|
||||||
const map = new Map(JSON.parse(localStorage.getItem("app-cache") || "[]"));
|
const map = new Map(JSON.parse(localStorage.getItem("app-cache") || "[]"));
|
||||||
|
@ -35,6 +35,10 @@ export enum LogLevel {
|
|||||||
let globalLogLevel = LogLevel.Info;
|
let globalLogLevel = LogLevel.Info;
|
||||||
const byTagLogLevel: Record<string, LogLevel> = {};
|
const byTagLogLevel: Record<string, LogLevel> = {};
|
||||||
|
|
||||||
|
export function getGlobalLogLevel(): string {
|
||||||
|
return globalLogLevel;
|
||||||
|
}
|
||||||
|
|
||||||
export function setGlobalLogLevelFromString(logLevelStr: string): void {
|
export function setGlobalLogLevelFromString(logLevelStr: string): void {
|
||||||
globalLogLevel = getLevelForString(logLevelStr);
|
globalLogLevel = getLevelForString(logLevelStr);
|
||||||
}
|
}
|
||||||
@ -98,7 +102,7 @@ function writeNodeLog(
|
|||||||
* and uses the corresponding console.* method to log in the browser.
|
* and uses the corresponding console.* method to log in the browser.
|
||||||
*/
|
*/
|
||||||
export class Logger {
|
export class Logger {
|
||||||
constructor(private tag: string) {}
|
constructor(private tag: string) { }
|
||||||
|
|
||||||
shouldLogTrace(): boolean {
|
shouldLogTrace(): boolean {
|
||||||
const level = byTagLogLevel[this.tag] ?? globalLogLevel;
|
const level = byTagLogLevel[this.tag] ?? globalLogLevel;
|
||||||
|
Loading…
Reference in New Issue
Block a user