code: def log(self, string):
          
  
          self.log_data.append(string)
          if self.log_function is None:
              print(string)
          else:
              self.log_function(string)
docs: appends input string to log file and sends it to log function (self.log_function)
          Returns: