mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-02-22 14:08:37 +01:00
read loglevel from env
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||
name: NSPanel Lovelace UI Addon
|
||||
version: "4.7.83"
|
||||
version: "4.7.84"
|
||||
slug: nspanel-lovelace-ui
|
||||
description: NSPanel Lovelace UI Addon
|
||||
services:
|
||||
|
||||
@@ -25,10 +25,18 @@ last_settings_file_mtime = 0
|
||||
mqtt_connect_time = 0
|
||||
has_sent_reload_command = False
|
||||
|
||||
log_level_name = os.getenv("loglevel", "DEBUG").upper()
|
||||
log_level = getattr(logging, log_level_name, None)
|
||||
invalid_log_level = not isinstance(log_level, int)
|
||||
if invalid_log_level:
|
||||
log_level = logging.DEBUG
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.DEBUG,
|
||||
level=log_level,
|
||||
format="%(asctime)s %(levelname)s [%(threadName)s] %(name)s: %(message)s",
|
||||
)
|
||||
if invalid_log_level:
|
||||
logging.warning("Invalid loglevel '%s', defaulting to DEBUG", log_level_name)
|
||||
|
||||
def on_ha_update(entity_id):
|
||||
global panel_in_queues
|
||||
|
||||
Reference in New Issue
Block a user