diff --git a/vnpy/trader/engine.py b/vnpy/trader/engine.py index 9ba94082..96d77e84 100644 --- a/vnpy/trader/engine.py +++ b/vnpy/trader/engine.py @@ -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) diff --git a/vnpy/trader/object.py b/vnpy/trader/object.py index f9b2e1b8..1618d609 100644 --- a/vnpy/trader/object.py +++ b/vnpy/trader/object.py @@ -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