From 5cfd32db9c20f0bd17af775e5470120c9c3d649b Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 30 Jan 2020 13:30:34 +0000 Subject: [IMP] core: only show JS stacktrace for exceptions & console.trace When revamping the message fetching from the headless browser, since stacktraces are available (by default) on console.error and console.warning events I assumed it could / would be useful to show them in the Python-level log. And they *were* quite useful during the original fixing stage. However they turn out not to be very useful day-to-day: * they add a lot of noise and lead to the error message itself being lost in a big block of red / logging.error * when a tour fails (which is the vast majority of the failures) the JS stacktrace always points to the same location in the tour manager (the one which goes "this step never succeeded") which is completely useless * aside from being bundled, normal JS code (where the stacktrace could be useful) doesn't generally use console.warn or console.error, it's going to straight blow up with an exception in which case we always get a stacktrace Leave the stacktrace formatting for console.trace as that's pretty much the only point of using this instead of console.log. closes odoo/odoo#44343 X-original-commit: 34500853f39c9557852cb83cbc274f59d803922f Signed-off-by: Xavier Morel (xmo) --- odoo/tests/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odoo/tests') diff --git a/odoo/tests/common.py b/odoo/tests/common.py index a62aad3b41a..447171cfd55 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -1103,7 +1103,7 @@ class ChromeBrowser(): LINE_PATTERN = '\tat %(functionName)s (%(url)s:%(lineNumber)d:%(columnNumber)d)\n' def _format_stack(self, logrecord): - if logrecord['type'] not in ('error', 'trace', 'warning'): + if logrecord['type'] not in ['trace']: return trace = logrecord.get('stackTrace') -- cgit v1.2.3