From 4691808a994c254e7b8a4a6ade3c7ea3e0c6c6e8 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Mon, 2 May 2022 11:41:39 +0200 Subject: [PATCH] L2SS-769: Reduce log spam if large attributes are given a default value --- tangostationcontrol/tangostationcontrol/devices/lofar_device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tangostationcontrol/tangostationcontrol/devices/lofar_device.py b/tangostationcontrol/tangostationcontrol/devices/lofar_device.py index 03a1fff0b..9c85266d4 100644 --- a/tangostationcontrol/tangostationcontrol/devices/lofar_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/lofar_device.py @@ -278,7 +278,7 @@ class lofar_device(Device, metaclass=DeviceMeta): default_value = getattr(self, f"{name}_default") # set the attribute to the configured default - logger.debug(f"Setting attribute {name} to {default_value if len(default_value) < 100 else (default_value[:100] + '...')}") + logger.debug(f"Setting attribute {name} to {default_value if len(str(default_value)) < 100 else (default_value[:100] + '...')}") self.proxy.write_attribute(name, default_value) except Exception as e: # log which attribute we're addressing -- GitLab