diff browser_side/contact.py @ 439:d52f529a6d42

browser side: use of new log system (first draft): - configuration is hardcoded in libervia.py, it will change in the (hopefuly) near future - log level is DEBUG for the moment, will be changed to INFO when configuration will not be hardcoded anymore - the basic log backend is used, in the future, a console.debug/info/etc should be used instead. A log widget which HTML colors is also an option
author Goffi <goffi@goffi.org>
date Thu, 08 May 2014 17:21:34 +0200
parents 7a8991cda2fa
children
line wrap: on
line diff
--- a/browser_side/contact.py	Thu May 08 17:21:30 2014 +0200
+++ b/browser_side/contact.py	Thu May 08 17:21:34 2014 +0200
@@ -18,6 +18,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import pyjd  # this is dummy in pyjs
+from sat.core.log import getLogger
+log = getLogger(__name__)
 from pyjamas.ui.SimplePanel import SimplePanel
 from pyjamas.ui.ScrollPanel import ScrollPanel
 from pyjamas.ui.VerticalPanel import VerticalPanel
@@ -264,7 +266,7 @@
         classname = 'widgetsPanel' if isinstance(self.getParent().getParent(), UniBoxPanel) else'gwt-TabBar'
         _elts = doc().getElementsByClassName(classname)
         if not _elts.length:
-            print ("ERROR: no element of class %s found, it should exist !" % classname)
+            log.error("no element of class %s found, it should exist !" % classname)
             tab_bar_h = height
         else:
             tab_bar_h = DOM.getAbsoluteTop(_elts.item(0)) or height  # getAbsoluteTop can be 0 if tabBar is hidden