diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-09-13 14:08:00 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-09-13 14:08:00 +0200 |
| commit | 22b3a157469aebe30d6c8b26a9b109b3d84c3ee9 (patch) | |
| tree | 10d8fa7fd439ffeeb40ae5763ba13011387b6a20 /addons/web/static/src | |
| parent | 754924a122d818ec90fde85c297fc8a2fcb60c03 (diff) | |
[imp] simplified logging api + fix problem with ie8 and logging
bzr revid: nicolas.vanhoren@openerp.com-20110913120800-m8tfmqoakruq78la
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/core.js | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index fbc730109f3..ce766d79d84 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -2,6 +2,10 @@ * OpenERP Web core *--------------------------------------------------------*/ +if (!console.debug) { + console.debug = console.log; +} + openerp.web.core = function(openerp) { openerp.web.qweb = new QWeb2.Engine(); openerp.web.qweb.debug = (window.location.search.indexOf('?debug') !== -1); @@ -741,33 +745,10 @@ openerp.web.SessionAware = openerp.web.CallbackEnabled.extend(/** @lends openerp }, log: function() { var args = Array.prototype.slice.call(arguments); - var caller = arguments.callee.caller; - // TODO add support for line number using - // https://github.com/emwendelin/javascript-stacktrace/blob/master/stacktrace.js - // args.unshift("" + caller.debug_name); this.on_log.apply(this,args); }, on_log: function() { - if(this.session.debug) { - var notify = false; - var body = false; - if(window.console) { - console.log(arguments); - } else { - body = true; - } - var a = Array.prototype.slice.call(arguments, 0); - for(var i = 0; i < a.length; i++) { - var v = a[i]==null ? "null" : a[i].toString(); - if(i==0) { - notify = v.match(/^not/); - body = v.match(/^bod/); - } - if(body) { - $('<pre></pre>').text(v).appendTo($('body')); - } - } - } + console.log.apply(console, arguments); } }); |
