mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 09:36:31 +00:00
parent
fb5d54d5fe
commit
f5dda39f63
@ -16,6 +16,7 @@ from .arch import CpuArch
|
||||
from .auth import Auth
|
||||
from .const import (
|
||||
ENV_HOMEASSISTANT_REPOSITORY,
|
||||
ENV_SUPERVISOR_DEV,
|
||||
ENV_SUPERVISOR_MACHINE,
|
||||
ENV_SUPERVISOR_NAME,
|
||||
ENV_SUPERVISOR_SHARE,
|
||||
@ -169,7 +170,7 @@ def initialize_system_data(coresys: CoreSys) -> None:
|
||||
coresys.config.modify_log_level()
|
||||
|
||||
# Check if ENV is in development mode
|
||||
if bool(os.environ.get("SUPERVISOR_DEV", 0)):
|
||||
if bool(os.environ.get(ENV_SUPERVISOR_DEV, 0)):
|
||||
_LOGGER.warning("SUPERVISOR_DEV is set")
|
||||
coresys.updater.channel = UpdateChannels.DEV
|
||||
coresys.config.logging = LogLevel.DEBUG
|
||||
@ -280,11 +281,11 @@ def supervisor_debugger(coresys: CoreSys) -> None:
|
||||
|
||||
def setup_diagnostics(coresys: CoreSys) -> None:
|
||||
"""Sentry diagnostic backend."""
|
||||
_LOGGER.info("Initialize Supervisor Sentry")
|
||||
dev_env: bool = bool(os.environ.get(ENV_SUPERVISOR_DEV, 0))
|
||||
|
||||
def filter_data(event, hint):
|
||||
# Ignore issue if system is not supported or diagnostics is disabled
|
||||
if not coresys.config.diagnostics or not coresys.supported:
|
||||
if not coresys.config.diagnostics or not coresys.supported or dev_env:
|
||||
return None
|
||||
|
||||
# Not full startup - missing information
|
||||
@ -325,6 +326,7 @@ def setup_diagnostics(coresys: CoreSys) -> None:
|
||||
level=logging.WARNING, event_level=logging.CRITICAL
|
||||
)
|
||||
|
||||
_LOGGER.info("Initialize Supervisor Sentry")
|
||||
sentry_sdk.init(
|
||||
dsn="https://9c6ea70f49234442b4746e447b24747e@o427061.ingest.sentry.io/5370612",
|
||||
before_send=filter_data,
|
||||
|
@ -74,6 +74,7 @@ ENV_HOMEASSISTANT_REPOSITORY = "HOMEASSISTANT_REPOSITORY"
|
||||
ENV_SUPERVISOR_SHARE = "SUPERVISOR_SHARE"
|
||||
ENV_SUPERVISOR_NAME = "SUPERVISOR_NAME"
|
||||
ENV_SUPERVISOR_MACHINE = "SUPERVISOR_MACHINE"
|
||||
ENV_SUPERVISOR_DEV = "SUPERVISOR_DEV"
|
||||
|
||||
REQUEST_FROM = "HASSIO_FROM"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user