Skip to content
Snippets Groups Projects
Commit 887269a8 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-769: Reduce log spam if large attributes are given a default value

parent 4691808a
No related branches found
No related tags found
1 merge request!317Resolve L2SS-769 "Implement digital beam"
......@@ -17,6 +17,7 @@ from tango import AttrWriteType, DevState, DebugIt, Attribute, DeviceProxy, Attr
import time
import math
import numpy
import textwrap
# Additional import
from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper
......@@ -278,7 +279,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(str(default_value)) < 100 else (default_value[:100] + '...')}")
logger.debug(textwrap.shorten(f"Setting attribute {name} to {default_value}", 150))
self.proxy.write_attribute(name, default_value)
except Exception as e:
# log which attribute we're addressing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment