code: protected void generateLog(boolean takeScreenshot, boolean saveSrc) {
          logger.entering(new Object[] { takeScreenshot, saveSrc });
          try {
              BaseLog log = createLog(saveSrc);
  
              String screenshotPath = null;
              log.setScreen(null);
  
              if (takeScreenshot) {
                  // screenshot
                  PageContents screen = new PageContents(Gatherer.takeScreenshot(Grid.driver()), getBaseFileName());
                  screenshotPath = saver.saveScreenshot(screen);
                  log.setScreen(screenshotPath);
              }
              // creating a string from all the info for the report to deserialize
              Reporter.log(log.toString());
          } catch (Exception e) {
              logger.log(Level.SEVERE, "error in the logging feature of SeLion " + e.getMessage(), e);
          }
          logger.exiting();
      }
docs: Generate a log message and send it to the TestNG {@link Reporter}
  
  @param takeScreenshot
  Take a screenshot <code>true/false</code>. Requires an active {@link Grid} session.
  @param saveSrc
  Save the current page source <code>true/false</code>. Requires an active {@link Grid} session.