From: Aleksander Ɓukasz Date: Wed, 5 Mar 2014 10:58:18 +0000 (+0100) Subject: fnpjs: logging - fixing console handler X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/854b444f63582fe4fd9aec7068c2d699b4ddbc01 fnpjs: logging - fixing console handler --- diff --git a/src/fnpjs/logging/handlers.js b/src/fnpjs/logging/handlers.js index f6f0509..5b14be6 100644 --- a/src/fnpjs/logging/handlers.js +++ b/src/fnpjs/logging/handlers.js @@ -6,9 +6,13 @@ define(function() { return { console: function(record) { /* global console */ - var method; + var level = record.level, + method; if(console) { - method = (typeof console[record.level] === 'function') ? record.level : 'log'; + if(level === 'warning') { + level = 'warn'; + } + method = (typeof console[level] === 'function') ? level : 'log'; console[method](record.message); } },