devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
40 lines (39 loc) • 1.15 kB
JavaScript
/**
* DevExtreme (cjs/core/utils/console.js)
* Version: 23.2.6
* Build date: Wed May 01 2024
*
* Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
exports.logger = exports.debug = void 0;
var _type = require("./type");
const noop = function() {};
const getConsoleMethod = function(method) {
if ("undefined" === typeof console || !(0, _type.isFunction)(console[method])) {
return noop
}
return console[method].bind(console)
};
const logger = {
log: getConsoleMethod("log"),
info: getConsoleMethod("info"),
warn: getConsoleMethod("warn"),
error: getConsoleMethod("error")
};
exports.logger = logger;
const debug = function() {
function assert(condition, message) {
if (!condition) {
throw new Error(message)
}
}
return {
assert: assert,
assertParam: function(parameter, message) {
assert(null !== parameter && void 0 !== parameter, message)
}
}
}();
exports.debug = debug;