Allow to update logger (#1035)

* Allow to update logger

* Fix bug
This commit is contained in:
Pascal Vizeli 2019-04-12 00:48:46 +02:00 committed by GitHub
parent 16ef6d82d2
commit 608c0e5076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -120,7 +120,8 @@ def initialize_system_data(coresys):
_LOGGER.info("Create Hass.io Apparmor folder %s", config.path_apparmor)
config.path_apparmor.mkdir()
return config
# Update log level
coresys.config.modify_log_level()
def migrate_system_env(coresys):

View File

@ -91,6 +91,12 @@ class CoreConfig(JsonConfig):
def logging(self, value: str):
"""Set system log level."""
self._data[ATTR_LOGGING] = value
self.modify_log_level()
def modify_log_level(self) -> None:
"""Change log level."""
lvl = getattr(logging, self.logging.upper())
logging.basicConfig(level=lvl)
@property
def last_boot(self):