示例#1
0
    def __init__(self,
                 model='self',
                 states=None,
                 initial='initial',
                 transitions=None,
                 send_event=False,
                 auto_transitions=True,
                 ordered_transitions=False,
                 ignore_invalid_triggers=None,
                 before_state_change=None,
                 after_state_change=None,
                 name=None,
                 queued=False,
                 prepare_event=None,
                 finalize_event=None,
                 **kwargs):
        super(StateMachine,
              self).__init__(model, states, initial, transitions, send_event,
                             auto_transitions, ordered_transitions,
                             ignore_invalid_triggers, before_state_change,
                             after_state_change, name, queued, prepare_event,
                             finalize_event, **kwargs)
        self.logger = logging.getLogger('transitions')
        self.logger.propagate = False
        self.logger.setLevel(1)

        global forwarding_handler
        if not forwarding_handler:
            forwarding_handler = ForwardingHandler(
                target_logger_name="moler.state_machine")
            self.logger.addHandler(forwarding_handler)
示例#2
0
 def _configure(self, config):
     super(MolerAsyncioScheduler, self)._configure(config)
     if not MolerAsyncioScheduler.forwarding_handler:
         self._logger.propagate = False
         self._logger.setLevel(1)
         MolerAsyncioScheduler.forwarding_handler = ForwardingHandler(
             target_logger_name=moler_scheduler)
         self._logger.addHandler(MolerAsyncioScheduler.forwarding_handler)