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
2 changed files with 8 additions and 1 deletions

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):