Disable logging by default for entity events (they can be quite spammy)

This commit is contained in:
Fabio Manganiello 2022-04-30 02:13:20 +02:00
parent 7df67aca82
commit c7970842d7
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -6,10 +6,14 @@ from platypush.message.event import Event
class EntityEvent(Event, ABC):
def __init__(self, entity: Union[Entity, dict], *args, **kwargs):
def __init__(
self, entity: Union[Entity, dict], *args, disable_logging=True, **kwargs
):
if isinstance(entity, Entity):
entity = entity.to_json()
super().__init__(entity=entity, *args, **kwargs)
super().__init__(
entity=entity, *args, disable_logging=disable_logging, **kwargs
)
class EntityUpdateEvent(EntityEvent):