예제 #1
0
    def write_log(self, msg: str, algo: AlgoTemplate = None):
        """"""
        if algo:
            msg = f"{algo.algo_name}:{msg}"

        log = LogData(msg=msg, gateway_name=APP_NAME)
        event = Event(EVENT_ALGO_LOG, data=log)
        self.event_engine.put(event)
예제 #2
0
 def write_log(self, msg: str):
     """"""
     log = LogData(
         msg=msg,
         gateway_name=APP_NAME
     )
     event = Event(EVENT_SPREAD_LOG, log)
     self.event_engine.put(event)
예제 #3
0
    def write_log(self, msg: str, strategy: CtaTemplate = None):
        """
        Create cta engine log event.
        """
        if strategy:
            msg = f"{strategy.strategy_name}: {msg}"

        log = LogData(msg=msg, gateway_name=APP_NAME)
        event = Event(type=EVENT_CTA_LOG, data=log)
        self.event_engine.put(event)
예제 #4
0
 def write_log(self, msg: str) -> None:
     """"""
     log = LogData(msg=msg, gateway_name=GATEWAY_NAME)
     self.put_event(EVENT_LOG, log)
예제 #5
0
 def write_log(self, msg: str):
     """"""
     log = LogData(msg=msg, gateway_name="RiskManager")
     event = Event(type=EVENT_LOG, data=log)
     self.event_engine.put(event)