def makeService(self, opts): ctrl = ProcessorController(cfile=opts['config']) conf = ctrl.config('recceiver') S = RecService(conf) S.addService(ctrl) S.ctrl = ctrl lvlname = conf.get('loglevel','WARN') lvl = logging.getLevelName(lvlname) if not isinstance(lvl, (int, long)): print "Invalid loglevel", lvlname lvl = logging.WARN fmt = conf.get('logformat', "%(levelname)s:%(name)s %(message)s") handle = Log2Twisted() handle.setFormatter(logging.Formatter(fmt)) root = logging.getLogger() root.addHandler(handle) root.setLevel(lvl) return S
def makeService(self, opts): ctrl = ProcessorController(cfile=opts['config']) S = RecService(ctrl.config('recceiver')) S.addService(ctrl) S.ctrl = ctrl return S