You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is helpful to allow the logger to work with dictionaries as well as objects. This lets you use the locals() function to get a dictionary of all local values.
This version of the logger allows it:
def update(self, dataContainersIn):
if self.save:
row = []
for (varGroup, container) in zip(self.varNames, dataContainersIn):
if type(container) is dict:
for var in varGroup:
row.append(container.get(var))
else:
for var in varGroup:
row.append(getattr(container, var))
self.csv_writer.writerow(row)
I wanted to use this syntax and was unable to: osl.log.add_attributes(locals(), ["active_test_conditions"])
The text was updated successfully, but these errors were encountered:
It is helpful to allow the logger to work with dictionaries as well as objects. This lets you use the
locals()
function to get a dictionary of all local values.This version of the logger allows it:
I wanted to use this syntax and was unable to:
osl.log.add_attributes(locals(), ["active_test_conditions"])
The text was updated successfully, but these errors were encountered: