code: def logstr(self, str):
      with open(self.filename, "a") as f:
          f.write(str + "\n")
          f.close()
      logging.getLogger("experiment_logger").info(str)
  
file_path: pytorch/caffe2/python/experiment_util.py
imports: import datetime
  import time
  import logging
  import socket
  import abc
  from collections import OrderedDict
label_desc: Use image node_id 2 for calling the ModelTrainerLog obj's underlying member method code with example usage: obj.logstr(str) without return types