code: public synchronized void fetchAndStoreLogsFromDriver(SessionId sessionId, WebDriver driver)
      throws IOException {
      if (!perSessionDriverEntries.containsKey(sessionId)) {
        perSessionDriverEntries.put(sessionId, new HashMap<>());
      }
      Map<String, LogEntries> typeToEntriesMap = perSessionDriverEntries.get(sessionId);
      if (storeLogsOnSessionQuit) {
        typeToEntriesMap.put(LogType.SERVER, getSessionLog(sessionId));
        Set<String> logTypeSet = driver.manage().logs().getAvailableLogTypes();
        for (String logType : logTypeSet) {
          typeToEntriesMap.put(logType, driver.manage().logs().get(logType));
        }
      }
    }
docs: Fetches and stores available logs from the given session and driver.
  
  @param sessionId The id of the session.
  @param driver The driver to get the logs from.
  @throws IOException If there was a problem reading from file.