code: def save_webdriver_logs_by_type(self, log_type, test_name):
          
          try:
              logs = self.driver_wrapper.driver.get_log(log_type)
          except Exception:
              return
  
          if len(logs) > 0:
              log_file_name = '{}_{}.txt'.format(get_valid_filename(test_name), log_type)
              log_file_name = os.path.join(DriverWrappersPool.logs_directory, log_file_name)
              with open(log_file_name, 'a+', encoding='utf-8') as log_file:
                  driver_type = self.driver_wrapper.config.get('Driver', 'type')
                  log_file.write(
                      u"\n{} '{}' test logs with driver = {}\n\n".format(datetime.now(), test_name, driver_type))
                  for entry in logs:
                      timestamp = datetime.fromtimestamp(float(entry['timestamp']) / 1000.).strftime(
                          '%Y-%m-%d %H:%M:%S.%f')
                      log_file.write(u'{}\t{}\t{}\n'.format(timestamp, entry['level'], entry['message'].rstrip()))
docs: Get webdriver logs of the specified type and write them to a log file
  
          :param log_type: browser, client, driver, performance, server, syslog, crashlog or logcat
          :param test_name: test that has generated these logs