comparison src/browser/sat_browser/logging.py @ 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 97c72fe4a5f2
children 9877607c719a
comparison
equal deleted inserted replaced
496:0924710b666a 497:516b06787c1a
24 24
25 25
26 class LiberviaLogger(log.Logger): 26 class LiberviaLogger(log.Logger):
27 27
28 def out(self, message, level=None): 28 def out(self, message, level=None):
29 try:
30 console
31 except:
32 # XXX: for older Firefox version, the displayed error is "libervia_main ReferenceError: console is not defined"
33 # but none of the following exception class is working: ReferenceError, TypeError, NameError, Exception...
34 # it works when you don't explicit a class, tested with Firefox 3.0.4
35 print message
36 return
29 if level == C.LOG_LVL_DEBUG: 37 if level == C.LOG_LVL_DEBUG:
30 console.debug(message) 38 console.debug(message)
31 elif level == C.LOG_LVL_INFO: 39 elif level == C.LOG_LVL_INFO:
32 console.info(message) 40 console.info(message)
33 elif level == C.LOG_LVL_WARNING: 41 elif level == C.LOG_LVL_WARNING: