

def log_actor_firing(self, actor_id, action_method, tokens_produced, tokens_consumed, production):
    ' Trace actor firing\n        '
    disconnected = []
    for (user_id, logger) in self.loggers.iteritems():
        if ((not logger.events) or (self.LOG_ACTOR_FIRING in logger.events)):
            if ((not logger.actors) or (actor_id in logger.actors)):
                data = {
                    
                }
                data['timestamp'] = time.time()
                data['node_id'] = self.node.id
                data['type'] = 'actor_fire'
                data['actor_id'] = actor_id
                data['action_method'] = action_method
                data['produced'] = tokens_produced
                data['consumed'] = tokens_consumed
                if (self.LOG_ACTION_RESULT in logger.events):
                    data['action_result'] = production
                if (logger.connection is not None):
                    if (not logger.connection.connection_lost):
                        logger.connection.send(('data: %s\n\n' % json.dumps(data)))
                    else:
                        disconnected.append(user_id)
                elif ((self.tunnel_client is not None) and (logger.handle is not None)):
                    msg = {
                        'cmd': 'logevent',
                        'msgid': logger.handle,
                        'header': None,
                        'data': ('data: %s\n\n' % json.dumps(data)),
                    }
                    self.tunnel_client.send(msg)
    for user_id in disconnected:
        del self.loggers[user_id]

dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/calvincontrol.py CalvinControl.log_actor_firing/original