changeset 497:516b06787c1a

browser_side: fix logging issue with older firefox version (e.g. 3.0.4)
author souliane <souliane@mailoo.org>
date Thu, 24 Jul 2014 12:20:36 +0200
parents 0924710b666a
children 60be99de3808
files src/browser/sat_browser/logging.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/sat_browser/logging.py	Thu Jul 17 12:59:33 2014 +0200
+++ b/src/browser/sat_browser/logging.py	Thu Jul 24 12:20:36 2014 +0200
@@ -26,6 +26,14 @@
 class LiberviaLogger(log.Logger):
 
     def out(self, message, level=None):
+        try:
+            console
+        except:
+            # XXX: for older Firefox version, the displayed error is "libervia_main ReferenceError: console is not defined"
+            # but none of the following exception class is working: ReferenceError, TypeError, NameError, Exception...
+            # it works when you don't explicit a class, tested with Firefox 3.0.4
+            print message
+            return
         if level == C.LOG_LVL_DEBUG:
             console.debug(message)
         elif level == C.LOG_LVL_INFO: