code: protected void log(SessionId sessionId, String commandName, Object toLog, When when) {
      if (!logger.isLoggable(level)) {
        return;
      }
      String text = String.valueOf(toLog);
      if (commandName.equals(DriverCommand.EXECUTE_SCRIPT)
          || commandName.equals(DriverCommand.EXECUTE_ASYNC_SCRIPT)) {
        if (text.length() > 100 && Boolean.getBoolean("webdriver.remote.shorten_log_messages")) {
          text = text.substring(0, 100) + "...";
        }
      }
      switch(when) {
        case BEFORE:
          logger.log(level, "Executing: " + commandName + " " + text);
          break;
        case AFTER:
          logger.log(level, "Executed: " + text);
          break;
        case EXCEPTION:
          logger.log(level, "Exception: " + text);
          break;
        default:
          logger.log(level, text);
          break;
      }
    }
docs: Override this to be notified at key points in the execution of a command.
  
  @param sessionId   the session id.
  @param commandName the command that is being executed.
  @param toLog       any data that might be interesting.
  @param when        verb tense of "Execute" to prefix message