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