From 59eb0742a1a096c7a54bb80ab473d1b9d8d9a836 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 29 Jan 2023 21:52:12 +0100 Subject: [PATCH] s/warnings/logger.debug/ if publish_entities is called with no engine registered --- platypush/entities/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platypush/entities/__init__.py b/platypush/entities/__init__.py index 361d67e5e1..5697abbe16 100644 --- a/platypush/entities/__init__.py +++ b/platypush/entities/__init__.py @@ -1,4 +1,4 @@ -import warnings +import logging from typing import Collection, Optional from ._base import Entity, get_entities_registry @@ -6,6 +6,7 @@ from ._engine import EntitiesEngine from ._registry import manages, register_entity_plugin, get_plugin_entity_registry _engine: Optional[EntitiesEngine] = None +logger = logging.getLogger(__name__) def init_entities_engine() -> EntitiesEngine: @@ -20,7 +21,7 @@ def init_entities_engine() -> EntitiesEngine: def publish_entities(entities: Collection[Entity]): if not _engine: - warnings.warn('No entities engine registered') + logger.debug('No entities engine registered') return _engine.post(*entities)