mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Do not log mqtt origin info if the log level does not allow it (#118752)
This commit is contained in:
parent
7bbfb1a22b
commit
70d7cedf08
@ -82,6 +82,9 @@ def async_log_discovery_origin_info(
|
|||||||
message: str, discovery_payload: MQTTDiscoveryPayload, level: int = logging.INFO
|
message: str, discovery_payload: MQTTDiscoveryPayload, level: int = logging.INFO
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Log information about the discovery and origin."""
|
"""Log information about the discovery and origin."""
|
||||||
|
if not _LOGGER.isEnabledFor(level):
|
||||||
|
# bail early if logging is disabled
|
||||||
|
return
|
||||||
if CONF_ORIGIN not in discovery_payload:
|
if CONF_ORIGIN not in discovery_payload:
|
||||||
_LOGGER.log(level, message)
|
_LOGGER.log(level, message)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user