2 * noVNC: HTML5 VNC client
3 * Copyright (C) 2019 The noVNC Authors
4 * Licensed under MPL 2.0 (see LICENSE.txt)
6 * See README.md for usage and integration instructions.
10 * Logging/debug routines
13let _logLevel = 'warn';
20export function initLogging(level) {
21 if (typeof level === 'undefined') {
27 Debug = Info = Warn = Error = () => {};
29 if (typeof window.console !== "undefined") {
30 /* eslint-disable no-console, no-fallthrough */
33 Debug = console.debug.bind(window.console);
35 Info = console.info.bind(window.console);
37 Warn = console.warn.bind(window.console);
39 Error = console.error.bind(window.console);
43 throw new window.Error("invalid logging type '" + level + "'");
45 /* eslint-enable no-console, no-fallthrough */
49export function getLogging() {
53export { Debug, Info, Warn, Error };
55// Initialize logging level