sugar-toolkit-gtk3/sugar/session/LogWriter.py

15 lines
367 B
Python
Raw Normal View History

2006-05-17 01:23:42 +02:00
import dbus
class LogWriter:
def __init__(self, application):
self._application = application
bus = dbus.SessionBus()
proxy_obj = bus.get_object('com.redhat.Sugar.Logger', '/com/redhat/Sugar/Logger')
self._logger = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Logger')
def write(self, s):
try:
self._logger.log(self._application, s)
except:
pass