diff src/bridge/bridge_constructor/dbus_frontend_template.py @ 993:301b342c697a

core: use of the new core.log module: /!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
author Goffi <goffi@goffi.org>
date Sat, 19 Apr 2014 19:19:19 +0200
parents 1fe00f0c9a91
children 95758ef3faa8
line wrap: on
line diff
--- a/src/bridge/bridge_constructor/dbus_frontend_template.py	Sat Apr 19 16:48:26 2014 +0200
+++ b/src/bridge/bridge_constructor/dbus_frontend_template.py	Sat Apr 19 19:19:19 2014 +0200
@@ -20,7 +20,8 @@
 from sat.core.i18n import _
 from bridge_frontend import BridgeFrontend
 import dbus
-from logging import debug, error
+from sat.core.log import getLogger
+log = getLogger(__name__)
 from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError
 
 from dbus.mainloop.glib import DBusGMainLoop
@@ -47,7 +48,7 @@
             if e._dbus_error_name == 'org.freedesktop.DBus.Error.ServiceUnknown':
                 raise BridgeExceptionNoService
             elif e._dbus_error_name == 'org.freedesktop.DBus.Error.NotSupported':
-                print u"D-Bus is not launched, please see README to see instructions on how to launch it"
+                log.error(_(u"D-Bus is not launched, please see README to see instructions on how to launch it"))
                 raise BridgeInitError
             else:
                 raise e
@@ -59,7 +60,7 @@
         elif iface == "plugin":
             self.db_plugin_iface.connect_to_signal(functionName, handler)
         else:
-            error(_('Unknown interface'))
+            log.error(_('Unknown interface'))
 
     def __getattribute__(self, name):
         """ usual __getattribute__ if the method exists, else try to find a plugin method """