SPB Git forge

spb/admin-ka

Public
41commits 1branches 0releases
172.9 MBsize
maindefault branch
19 days agolast push
JavaScript 65.5% Python 17.8% CSS 13% HTML 3.7%
1.6 KB · 56 lines javascript
Raw Blame History
1"use strict";23Object.defineProperty(exports, "__esModule", {4  value: true5});6exports.Warn = exports.Info = exports.Error = exports.Debug = void 0;7exports.getLogging = getLogging;8exports.initLogging = initLogging;9/*10 * noVNC: HTML5 VNC client11 * Copyright (C) 2019 The noVNC authors12 * Licensed under MPL 2.0 (see LICENSE.txt)13 *14 * See README.md for usage and integration instructions.15 */1617/*18 * Logging/debug routines19 */2021var _logLevel = 'warn';22var Debug = exports.Debug = function Debug() {};23var Info = exports.Info = function Info() {};24var Warn = exports.Warn = function Warn() {};25var Error = exports.Error = function Error() {};26function initLogging(level) {27  if (typeof level === 'undefined') {28    level = _logLevel;29  } else {30    _logLevel = level;31  }32  exports.Debug = Debug = exports.Info = Info = exports.Warn = Warn = exports.Error = Error = function Error() {};33  if (typeof window.console !== "undefined") {34    /* eslint-disable no-console, no-fallthrough */35    switch (level) {36      case 'debug':37        exports.Debug = Debug = console.debug.bind(window.console);38      case 'info':39        exports.Info = Info = console.info.bind(window.console);40      case 'warn':41        exports.Warn = Warn = console.warn.bind(window.console);42      case 'error':43        exports.Error = Error = console.error.bind(window.console);44      case 'none':45        break;46      default:47        throw new window.Error("invalid logging type '" + level + "'");48    }49    /* eslint-enable no-console, no-fallthrough */50  }51}52function getLogging() {53  return _logLevel;54}55// Initialize logging level56initLogging();