mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-14 04:36:31 +00:00
Enable debug logging early (#5908)
Set logging level early in the bootstrap process so we can use debug level messages in the early stages of the Supervisor.
This commit is contained in:
parent
9e6a4d65cd
commit
87232cf1e4
@ -54,6 +54,14 @@ async def initialize_coresys() -> CoreSys:
|
|||||||
"""Initialize supervisor coresys/objects."""
|
"""Initialize supervisor coresys/objects."""
|
||||||
coresys = await CoreSys().load_config()
|
coresys = await CoreSys().load_config()
|
||||||
|
|
||||||
|
# Check if ENV is in development mode
|
||||||
|
if coresys.dev:
|
||||||
|
_LOGGER.warning("Environment variable 'SUPERVISOR_DEV' is set")
|
||||||
|
coresys.config.logging = LogLevel.DEBUG
|
||||||
|
coresys.config.debug = True
|
||||||
|
else:
|
||||||
|
coresys.config.modify_log_level()
|
||||||
|
|
||||||
# Initialize core objects
|
# Initialize core objects
|
||||||
coresys.docker = await DockerAPI(coresys).post_init()
|
coresys.docker = await DockerAPI(coresys).post_init()
|
||||||
coresys.resolution = await ResolutionManager(coresys).load_config()
|
coresys.resolution = await ResolutionManager(coresys).load_config()
|
||||||
@ -93,15 +101,9 @@ async def initialize_coresys() -> CoreSys:
|
|||||||
# bootstrap config
|
# bootstrap config
|
||||||
initialize_system(coresys)
|
initialize_system(coresys)
|
||||||
|
|
||||||
# Check if ENV is in development mode
|
|
||||||
if coresys.dev:
|
if coresys.dev:
|
||||||
_LOGGER.warning("Environment variable 'SUPERVISOR_DEV' is set")
|
|
||||||
coresys.config.logging = LogLevel.DEBUG
|
|
||||||
coresys.config.debug = True
|
|
||||||
coresys.updater.channel = UpdateChannel.DEV
|
coresys.updater.channel = UpdateChannel.DEV
|
||||||
coresys.security.content_trust = False
|
coresys.security.content_trust = False
|
||||||
else:
|
|
||||||
coresys.config.modify_log_level()
|
|
||||||
|
|
||||||
# Convert datetime
|
# Convert datetime
|
||||||
logging.Formatter.converter = lambda *args: coresys.now().timetuple()
|
logging.Formatter.converter = lambda *args: coresys.now().timetuple()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user