This commit is contained in:
vn.py 2019-03-07 13:28:19 +08:00
parent 8c07d1de4f
commit c5accfc44b
2 changed files with 4 additions and 4 deletions

View File

@ -77,11 +77,11 @@ class MainEngine:
self.add_engine(OmsEngine)
self.add_engine(EmailEngine)
def write_log(self, msg: str):
def write_log(self, msg: str, source: str = ""):
"""
Put log event with specific message.
"""
log = LogData(msg=msg)
log = LogData(msg=msg, gateway_name=source)
event = Event(EVENT_LOG, log)
self.event_engine.put(event)

View File

@ -14,8 +14,8 @@ ACTIVE_STATUSES = set([Status.SUBMITTING, Status.NOTTRADED, Status.PARTTRADED])
@dataclass
class BaseData:
"""
Any data object needs a gateway_name as source or
destination and should inherit base data.
Any data object needs a gateway_name as source
and should inherit base data.
"""
gateway_name: str