debug-server-next
Version:
Dev server for hippy-core.
1,025 lines (857 loc) • 31 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
var a = factory();
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})((0, eval)("this"), function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./client-src/modules/logger/index.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "../../node_modules/process/browser.js":
/*!********************************************************************************************************************!*\
!*** /Users/shenchaoran/Workspace/tencent/dynamic-framework/devtools-debug-server/node_modules/process/browser.js ***!
\********************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout() {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
})();
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
} // if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch (e) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch (e) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
} // if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while (len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
}; // v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) {
return [];
};
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () {
return '/';
};
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function () {
return 0;
};
/***/ }),
/***/ "../../node_modules/webpack/lib/logging/Logger.js":
/*!***************************************!*\
!*** (webpack)/lib/logging/Logger.js ***!
\***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
;
/* WEBPACK VAR INJECTION */(function(process) {/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _iterableToArray(iter) {
if (typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && iter[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
var LogType = Object.freeze({
error:
/** @type {"error"} */
"error",
// message, c style arguments
warn:
/** @type {"warn"} */
"warn",
// message, c style arguments
info:
/** @type {"info"} */
"info",
// message, c style arguments
log:
/** @type {"log"} */
"log",
// message, c style arguments
debug:
/** @type {"debug"} */
"debug",
// message, c style arguments
trace:
/** @type {"trace"} */
"trace",
// no arguments
group:
/** @type {"group"} */
"group",
// [label]
groupCollapsed:
/** @type {"groupCollapsed"} */
"groupCollapsed",
// [label]
groupEnd:
/** @type {"groupEnd"} */
"groupEnd",
// [label]
profile:
/** @type {"profile"} */
"profile",
// [profileName]
profileEnd:
/** @type {"profileEnd"} */
"profileEnd",
// [profileName]
time:
/** @type {"time"} */
"time",
// name, time as [seconds, nanoseconds]
clear:
/** @type {"clear"} */
"clear",
// no arguments
status:
/** @type {"status"} */
"status" // message, arguments
});
exports.LogType = LogType;
/** @typedef {typeof LogType[keyof typeof LogType]} LogTypeEnum */
var LOG_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })("webpack logger raw log method");
var TIMERS_SYMBOL = (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })("webpack logger times");
var WebpackLogger = /*#__PURE__*/function () {
/**
* @param {function(LogTypeEnum, any[]=): void} log log function
*/
function WebpackLogger(log) {
_classCallCheck(this, WebpackLogger);
this[LOG_SYMBOL] = log;
}
_createClass(WebpackLogger, [{
key: "error",
value: function error() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
this[LOG_SYMBOL](LogType.error, args);
}
}, {
key: "warn",
value: function warn() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
this[LOG_SYMBOL](LogType.warn, args);
}
}, {
key: "info",
value: function info() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
this[LOG_SYMBOL](LogType.info, args);
}
}, {
key: "log",
value: function log() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
this[LOG_SYMBOL](LogType.log, args);
}
}, {
key: "debug",
value: function debug() {
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
this[LOG_SYMBOL](LogType.debug, args);
}
}, {
key: "assert",
value: function assert(assertion) {
if (!assertion) {
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
args[_key6 - 1] = arguments[_key6];
}
this[LOG_SYMBOL](LogType.error, args);
}
}
}, {
key: "trace",
value: function trace() {
this[LOG_SYMBOL](LogType.trace, ["Trace"]);
}
}, {
key: "clear",
value: function clear() {
this[LOG_SYMBOL](LogType.clear);
}
}, {
key: "status",
value: function status() {
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}
this[LOG_SYMBOL](LogType.status, args);
}
}, {
key: "group",
value: function group() {
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
args[_key8] = arguments[_key8];
}
this[LOG_SYMBOL](LogType.group, args);
}
}, {
key: "groupCollapsed",
value: function groupCollapsed() {
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
args[_key9] = arguments[_key9];
}
this[LOG_SYMBOL](LogType.groupCollapsed, args);
}
}, {
key: "groupEnd",
value: function groupEnd() {
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
args[_key10] = arguments[_key10];
}
this[LOG_SYMBOL](LogType.groupEnd, args);
}
}, {
key: "profile",
value: function profile(label) {
this[LOG_SYMBOL](LogType.profile, [label]);
}
}, {
key: "profileEnd",
value: function profileEnd(label) {
this[LOG_SYMBOL](LogType.profileEnd, [label]);
}
}, {
key: "time",
value: function time(label) {
this[TIMERS_SYMBOL] = this[TIMERS_SYMBOL] || new Map();
this[TIMERS_SYMBOL].set(label, process.hrtime());
}
}, {
key: "timeLog",
value: function timeLog(label) {
var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label);
if (!prev) {
throw new Error("No such label '".concat(label, "' for WebpackLogger.timeLog()"));
}
var time = process.hrtime(prev);
this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time)));
}
}, {
key: "timeEnd",
value: function timeEnd(label) {
var prev = this[TIMERS_SYMBOL] && this[TIMERS_SYMBOL].get(label);
if (!prev) {
throw new Error("No such label '".concat(label, "' for WebpackLogger.timeEnd()"));
}
var time = process.hrtime(prev);
this[TIMERS_SYMBOL].delete(label);
this[LOG_SYMBOL](LogType.time, [label].concat(_toConsumableArray(time)));
}
}]);
return WebpackLogger;
}();
exports.Logger = WebpackLogger;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../process/browser.js */ "../../node_modules/process/browser.js")))
/***/ }),
/***/ "../../node_modules/webpack/lib/logging/createConsoleLogger.js":
/*!****************************************************!*\
!*** (webpack)/lib/logging/createConsoleLogger.js ***!
\****************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
;
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _iterableToArray(iter) {
if (typeof (typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }) !== "undefined" && iter[(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; }).iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
var _require = __webpack_require__(/*! ./Logger */ "../../node_modules/webpack/lib/logging/Logger.js"),
LogType = _require.LogType;
/** @typedef {import("./Logger").LogTypeEnum} LogTypeEnum */
/** @typedef {import("../../declarations/WebpackOptions").FilterTypes} FilterTypes */
/** @typedef {import("../../declarations/WebpackOptions").FilterItemTypes} FilterItemTypes */
/** @typedef {function(string): boolean} FilterFunction */
/**
* @typedef {Object} LoggerOptions
* @property {false|true|"none"|"error"|"warn"|"info"|"log"|"verbose"} level loglevel
* @property {FilterTypes|boolean} debug filter for debug logging
* @property {Console & { status?: Function, logTime?: Function }} console the console to log to
*/
/**
* @param {FilterItemTypes} item an input item
* @returns {FilterFunction} filter funtion
*/
var filterToFunction = function filterToFunction(item) {
if (typeof item === "string") {
var regExp = new RegExp("[\\\\/]".concat(item.replace( // eslint-disable-next-line no-useless-escape
/[-[\]{}()*+?.\\^$|]/g, "\\$&"), "([\\\\/]|$|!|\\?)"));
return function (ident) {
return regExp.test(ident);
};
}
if (item && typeof item === "object" && typeof item.test === "function") {
return function (ident) {
return item.test(ident);
};
}
if (typeof item === "function") {
return item;
}
if (typeof item === "boolean") {
return function () {
return item;
};
}
};
/**
* @enum {number}
*/
var LogLevel = {
none: 6,
false: 6,
error: 5,
warn: 4,
info: 3,
log: 2,
true: 2,
verbose: 1
};
/**
* @param {LoggerOptions} options options object
* @returns {function(string, LogTypeEnum, any[]): void} logging function
*/
module.exports = function (_ref) {
var _ref$level = _ref.level,
level = _ref$level === void 0 ? "info" : _ref$level,
_ref$debug = _ref.debug,
debug = _ref$debug === void 0 ? false : _ref$debug,
console = _ref.console;
var debugFilters = typeof debug === "boolean" ? [function () {
return debug;
}] :
/** @type {FilterItemTypes[]} */
[].concat(debug).map(filterToFunction);
/** @type {number} */
var loglevel = LogLevel["".concat(level)] || 0;
/**
* @param {string} name name of the logger
* @param {LogTypeEnum} type type of the log entry
* @param {any[]} args arguments of the log entry
* @returns {void}
*/
var logger = function logger(name, type, args) {
var labeledArgs = function labeledArgs() {
if (Array.isArray(args)) {
if (args.length > 0 && typeof args[0] === "string") {
return ["[".concat(name, "] ").concat(args[0])].concat(_toConsumableArray(args.slice(1)));
} else {
return ["[".concat(name, "]")].concat(_toConsumableArray(args));
}
} else {
return [];
}
};
var debug = debugFilters.some(function (f) {
return f(name);
});
switch (type) {
case LogType.debug:
if (!debug) return; // eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.debug === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.debug.apply(console, _toConsumableArray(labeledArgs()));
} else {
console.log.apply(console, _toConsumableArray(labeledArgs()));
}
break;
case LogType.log:
if (!debug && loglevel > LogLevel.log) return;
console.log.apply(console, _toConsumableArray(labeledArgs()));
break;
case LogType.info:
if (!debug && loglevel > LogLevel.info) return;
console.info.apply(console, _toConsumableArray(labeledArgs()));
break;
case LogType.warn:
if (!debug && loglevel > LogLevel.warn) return;
console.warn.apply(console, _toConsumableArray(labeledArgs()));
break;
case LogType.error:
if (!debug && loglevel > LogLevel.error) return;
console.error.apply(console, _toConsumableArray(labeledArgs()));
break;
case LogType.trace:
if (!debug) return;
console.trace();
break;
case LogType.groupCollapsed:
if (!debug && loglevel > LogLevel.log) return;
if (!debug && loglevel > LogLevel.verbose) {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.groupCollapsed === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.groupCollapsed.apply(console, _toConsumableArray(labeledArgs()));
} else {
console.log.apply(console, _toConsumableArray(labeledArgs()));
}
break;
}
// falls through
case LogType.group:
if (!debug && loglevel > LogLevel.log) return; // eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.group === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.group.apply(console, _toConsumableArray(labeledArgs()));
} else {
console.log.apply(console, _toConsumableArray(labeledArgs()));
}
break;
case LogType.groupEnd:
if (!debug && loglevel > LogLevel.log) return; // eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.groupEnd === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.groupEnd();
}
break;
case LogType.time:
{
if (!debug && loglevel > LogLevel.log) return;
var ms = args[1] * 1000 + args[2] / 1000000;
var msg = "[".concat(name, "] ").concat(args[0], ": ").concat(ms, "ms");
if (typeof console.logTime === "function") {
console.logTime(msg);
} else {
console.log(msg);
}
break;
}
case LogType.profile:
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.profile === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.profile.apply(console, _toConsumableArray(labeledArgs()));
}
break;
case LogType.profileEnd:
// eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.profileEnd === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.profileEnd.apply(console, _toConsumableArray(labeledArgs()));
}
break;
case LogType.clear:
if (!debug && loglevel > LogLevel.log) return; // eslint-disable-next-line node/no-unsupported-features/node-builtins
if (typeof console.clear === "function") {
// eslint-disable-next-line node/no-unsupported-features/node-builtins
console.clear();
}
break;
case LogType.status:
if (!debug && loglevel > LogLevel.info) return;
if (typeof console.status === "function") {
if (args.length === 0) {
console.status();
} else {
console.status.apply(console, _toConsumableArray(labeledArgs()));
}
} else {
if (args.length !== 0) {
console.info.apply(console, _toConsumableArray(labeledArgs()));
}
}
break;
default:
throw new Error("Unexpected LogType ".concat(type));
}
};
return logger;
};
/***/ }),
/***/ "../../node_modules/webpack/lib/logging/runtime.js":
/*!****************************************!*\
!*** (webpack)/lib/logging/runtime.js ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var SyncBailHook = __webpack_require__(/*! tapable/lib/SyncBailHook */ "./client-src/modules/logger/SyncBailHookFake.js");
var _require = __webpack_require__(/*! ./Logger */ "../../node_modules/webpack/lib/logging/Logger.js"),
Logger = _require.Logger;
var createConsoleLogger = __webpack_require__(/*! ./createConsoleLogger */ "../../node_modules/webpack/lib/logging/createConsoleLogger.js");
/** @type {createConsoleLogger.LoggerOptions} */
var currentDefaultLoggerOptions = {
level: "info",
debug: false,
console: console
};
var currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions);
/**
* @param {string} name name of the logger
* @returns {Logger} a logger
*/
exports.getLogger = function (name) {
return new Logger(function (type, args) {
if (exports.hooks.log.call(name, type, args) === undefined) {
currentDefaultLogger(name, type, args);
}
});
};
/**
* @param {createConsoleLogger.LoggerOptions} options new options, merge with old options
* @returns {void}
*/
exports.configureDefaultLogger = function (options) {
_extends(currentDefaultLoggerOptions, options);
currentDefaultLogger = createConsoleLogger(currentDefaultLoggerOptions);
};
exports.hooks = {
log: new SyncBailHook(["origin", "type", "args"])
};
/***/ }),
/***/ "./client-src/modules/logger/SyncBailHookFake.js":
/*!*******************************************************!*\
!*** ./client-src/modules/logger/SyncBailHookFake.js ***!
\*******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
;
/**
* Client stub for tapable SyncBailHook
*/
module.exports = function clientTapableSyncBailHook() {
return {
call: function call() {}
};
};
/***/ }),
/***/ "./client-src/modules/logger/index.js":
/*!********************************************!*\
!*** ./client-src/modules/logger/index.js ***!
\********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
;
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var webpack_lib_logging_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webpack/lib/logging/runtime */ "../../node_modules/webpack/lib/logging/runtime.js");
/* harmony import */ var webpack_lib_logging_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(webpack_lib_logging_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "default", function() { return webpack_lib_logging_runtime__WEBPACK_IMPORTED_MODULE_0___default.a; });
/***/ })
/******/ });
});