[logger] Don't allow `logger.log actions without configuring the logger`

This commit is contained in:
Jesse Hills 2025-07-23 14:07:49 +12:00
parent 7bfb08e602
commit 5dc1cb8e47
No known key found for this signature in database
GPG Key ID: BEAAE804EFD8E83A

View File

@ -422,6 +422,7 @@ CONF_LOGGER_LOG = "logger.log"
LOGGER_LOG_ACTION_SCHEMA = cv.All(
cv.maybe_simple_value(
{
cv.GenerateID(CONF_LOGGER_ID): cv.use_id(Logger),
cv.Required(CONF_FORMAT): cv.string,
cv.Optional(CONF_ARGS, default=list): cv.ensure_list(cv.lambda_),
cv.Optional(CONF_LEVEL, default="DEBUG"): cv.one_of(