In a python simulation code, code outputs are located in a nested-dict. I'm interested to log this nested dict to file at the end of each iteration, and having trouble identifying the best practice approach. In a current method, the nest_dict is logged by passing it to a logger like:
self.logger.info(self.input_dict)
But this produces a perhaps wasteful output file, as the dictionary is represented as it would appear with
print(self.input_dict)
So my related questions are:
- Are there any best practices around logging nested dictionaries?
- Is logging.info the correct method to use or are there dedicated methods in python for logging data, versus logging events?