Skip to content

Commit

Permalink
changed Common.log to use console.warn
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Jan 21, 2015
1 parent 9aa0945 commit c220f41
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,23 +253,21 @@ var Common = {};
* @param {string} type
*/
Common.log = function(message, type) {
if (!console || !console.log)
if (!console || !console.log || !console.warn)
return;

var style;

switch (type) {

case 'warn':
style = 'color: coral';
console.warn('Matter.js:', message);
break;
case 'error':
style = 'color: red';
console.log('Matter.js:', message);
break;

}

console.log('%c [Matter] ' + type + ': ' + message, style);
};

/**
Expand Down

0 comments on commit c220f41

Please sign in to comment.