Merge pull request #277 from ajmirsky/broker_script_logging

Improved broker script logging
pull/278/head
Andrew Mirsky 2025-07-16 18:26:06 -04:00 zatwierdzone przez GitHub
commit 54c6b13900
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -41,9 +41,12 @@ def broker_main(
) -> None:
"""Command-line script for running a MQTT 3.1.1 broker."""
formatter = "[%(asctime)s] :: %(levelname)s - %(message)s"
if debug:
formatter = "[%(asctime)s] %(name)s:%(lineno)d :: %(levelname)s - %(message)s"
level = logging.DEBUG if debug else logging.INFO
logging.basicConfig(level=level, format=formatter)
logging.getLogger("transitions").setLevel(logging.WARNING)
try:
if config_file:
config = read_yaml_config(config_file)