Reduce log-spam.
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled

done as part of CURA-12708
This commit is contained in:
Remco Burema 2025-09-30 11:38:33 +02:00
parent 971fb9d104
commit fb574bba25

View file

@ -32,6 +32,8 @@ class ZeroConfClient:
self._service_changed_request_event = None # type: Optional[Event]
self._service_changed_request_thread = None # type: Optional[Thread]
self._warn_once_no_address_services = set()
def start(self) -> None:
"""The ZeroConf service changed requests are handled in a separate thread so we don't block the UI.
@ -145,9 +147,11 @@ class ZeroConfClient:
address = '.'.join(map(str, info.addresses[0]))
self.addedNetworkCluster.emit(str(name), address, info.properties)
else:
Logger.log("w", "The type of the found device is '%s', not 'printer'." % type_of_device)
Logger.warning(f"The type of the found device is '{type_of_device}', not 'printer'.")
else:
Logger.log("w", "Could not get information about %s" % name)
if name not in self._warn_once_no_address_services:
self._warn_once_no_address_services.add(name)
Logger.warning(f"Could not get information about '{name}'.")
return False
return True