mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-12 02:10:59 +00:00
27 lines
632 B
JavaScript
27 lines
632 B
JavaScript
/**
|
|
* Wrapper around `console.log` (when available)
|
|
* @param {*} [values] Values to log
|
|
*/
|
|
fabric.log = function() { };
|
|
|
|
/**
|
|
* Wrapper around `console.warn` (when available)
|
|
* @param {*} [values] Values to log as a warning
|
|
*/
|
|
fabric.warn = function() { };
|
|
|
|
/* eslint-disable */
|
|
if (typeof console !== 'undefined') {
|
|
|
|
['log', 'warn'].forEach(function(methodName) {
|
|
|
|
if (typeof console[methodName] !== 'undefined' &&
|
|
typeof console[methodName].apply === 'function') {
|
|
|
|
fabric[methodName] = function() {
|
|
return console[methodName].apply(console, arguments);
|
|
};
|
|
}
|
|
});
|
|
}
|
|
/* eslint-enable */
|