mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Fix default value when logger used (#94269)
This commit is contained in:
parent
18cbc9b4c3
commit
76535d3f7d
@ -13,7 +13,6 @@ from homeassistant.helpers.typing import ConfigType
|
|||||||
from . import websocket_api
|
from . import websocket_api
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_LEVEL,
|
ATTR_LEVEL,
|
||||||
DEFAULT_LOGSEVERITY,
|
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
LOGGER_DEFAULT,
|
LOGGER_DEFAULT,
|
||||||
LOGGER_FILTERS,
|
LOGGER_FILTERS,
|
||||||
@ -39,9 +38,7 @@ CONFIG_SCHEMA = vol.Schema(
|
|||||||
{
|
{
|
||||||
DOMAIN: vol.Schema(
|
DOMAIN: vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Optional(
|
vol.Optional(LOGGER_DEFAULT): _VALID_LOG_LEVEL,
|
||||||
LOGGER_DEFAULT, default=DEFAULT_LOGSEVERITY
|
|
||||||
): _VALID_LOG_LEVEL,
|
|
||||||
vol.Optional(LOGGER_LOGS): vol.Schema({cv.string: _VALID_LOG_LEVEL}),
|
vol.Optional(LOGGER_LOGS): vol.Schema({cv.string: _VALID_LOG_LEVEL}),
|
||||||
vol.Optional(LOGGER_FILTERS): vol.Schema({cv.string: [cv.is_regex]}),
|
vol.Optional(LOGGER_FILTERS): vol.Schema({cv.string: [cv.is_regex]}),
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ class LoggerSettings:
|
|||||||
|
|
||||||
self._yaml_config = yaml_config
|
self._yaml_config = yaml_config
|
||||||
self._default_level = logging.INFO
|
self._default_level = logging.INFO
|
||||||
if DOMAIN in yaml_config:
|
if DOMAIN in yaml_config and LOGGER_DEFAULT in yaml_config[DOMAIN]:
|
||||||
self._default_level = yaml_config[DOMAIN][LOGGER_DEFAULT]
|
self._default_level = yaml_config[DOMAIN][LOGGER_DEFAULT]
|
||||||
self._store: Store[dict[str, dict[str, dict[str, Any]]]] = Store(
|
self._store: Store[dict[str, dict[str, dict[str, Any]]]] = Store(
|
||||||
hass, STORAGE_VERSION, STORAGE_KEY
|
hass, STORAGE_VERSION, STORAGE_KEY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user