add more logs

This commit is contained in:
yanyongyu
2020-08-25 18:02:18 +08:00
parent c5ea8bc1c3
commit cef3a8236e
5 changed files with 115 additions and 30 deletions

View File

@ -54,18 +54,32 @@ class BaseEvent(abc.ABC):
self._raw_event = raw_event
def __repr__(self) -> str:
# TODO: pretty print
return f"<Event: {self.type}/{self.detail_type} {self.raw_message}>"
return f"<Event {self.self_id}: {self.name} {self.time}>"
@property
def raw_event(self) -> dict:
return self._raw_event
@property
@abc.abstractmethod
def id(self) -> int:
raise NotImplementedError
@property
@abc.abstractmethod
def name(self) -> str:
raise NotImplementedError
@property
@abc.abstractmethod
def self_id(self) -> str:
raise NotImplementedError
@property
@abc.abstractmethod
def time(self) -> int:
raise NotImplementedError
@property
@abc.abstractmethod
def type(self) -> str: