retracing how the hub config was built to help debugging.

@return html representation of the hub config
967798
private String getConfigInfo() {
    StringBuilder builder = new StringBuilder();

    builder.append("<div id='hub-config-container'>");
    GridHubConfiguration config = getRegistry().getHub().getConfiguration();
    builder.append("<div id='hub-config-content'>");
    builder.append("<b>Config for the hub :</b><br/>");
    builder.append(prettyHtmlPrint(config));
    builder.append(getVerboseConfig()); // Display verbose configuration details
    builder.append("</div>"); // End of Config Content

    // Display View/Hide Link at the bottom beneath the details
    builder.append("<a id='config-view-toggle' href='#'>View Config</a>");
    builder.append("</div>"); // End of Config Container
    return builder.toString();
  }
691065
public static function getEnvHtml()
    {
        $env = \Mmi\App\FrontController::getInstance()->getEnvironment();
        return '<p style="margin: 0; padding: 0;">Connection: <b>' . $env->serverAddress . ':' . $env->serverPort . '</b> <---> <b>' . $env->remoteAddress . ':' . $env->remotePort . '</b></p>' .
            '<p style="margin: 0; padding: 0;">Browser: <b>' . substr($env->httpUserAgent, 0, 93) . '</b></p>' .
            '<p style="margin: 0; padding: 0;">PHP: <b>' . phpversion() . ' (' . php_sapi_name() . ', ' . php_uname('s') . ' ' . php_uname('m') . ': ' . php_uname('n') . ')</b></p>' .
            '<p style="margin: 0; padding: 0;">Path: <b>' . $env->scriptFileName . '</b></p>';
    }
520118
public String htmlModules() {

        StringBuffer html = new StringBuffer(1024);
        Iterator<String> itModules = sortModules(getAvailableModules().values()).iterator();
        for (int i = 0; itModules.hasNext(); i++) {
            String moduleName = itModules.next();
            CmsModule module = getAvailableModules().get(moduleName);
            html.append(htmlModule(module, i));
        }
        return html.toString();
    }
79176
public String toHtml() {
        StringBuilder stringBuilder = new StringBuilder();

        stringBuilder
                .append("<p>")
                .append(objectNode.get(TYPE).asText()).append(": ")
                .append(objectNode.get(MESSAGE).asText()).append(" -> ")
                .append(objectNode.get(DETAILS).toString())
                .append("</p>");

        return stringBuilder.toString();
    }
1082449
public function build(): string
    {
        $html_attr = [];

        if (!$this->element) {
            $this->element = strtolower((new \ReflectionClass($this))->getShortName());
        }

        if (!empty($this->id)) {
            $html_attr['id'] = $this->id;
        }

        if (!empty($this->name)) {
            $html_attr['name'] = $this->name;
        }

        if ($this->css) {
            $this->css = array_unique($this->css);
            $html_attr['class'] = implode(' ', $this->css);
        }

        if ($this->style) {

            $styles = [];

            foreach ($this->style as $name => $val) {
                $styles[] = $name . ': ' . $val;
            }

            $html_attr['style'] = implode('; ', $styles);
        }

        if ($this->event) {
            foreach ($this->event as $event => $val) {
                $html_attr[$event] = $val;
            }
        }

        if ($this->data) {
            foreach ($this->data as $attr => $val) {
                $html_attr['data-' . $attr] = $val;
            }
        }

        if ($this->aria) {
            foreach ($this->aria as $attr => $val) {
                $html_attr['aria-' . $attr] = $val;
            }
        }

        if ($this->attribute) {
            foreach ($this->attribute as $attr => $val) {
                $html_attr[$attr] = $val;
            }
        }

        // we have all our attributes => build attribute string
        $tmp_attr = [];

        foreach ($html_attr as $name => $val) {
            $tmp_attr[] = $val === false ? $name : $name . (strpos($name, 'data') === false ? '="' . $val . '"' : '=\'' . $val . '\'');
        }

        $html_attr = implode(' ', $tmp_attr);

        // html attribute string has been created, lets build the element
        switch ($this->element) {

            case 'input':
            case 'meta':
            case 'img':
            case 'link':
                $html = '<' . $this->element . ($html_attr ? ' ' . $html_attr : '') . '>';
                break;

            default:
                $html = '<' . $this->element . ($html_attr ? ' ' . $html_attr : '') . '>' . $this->inner . '</' . $this->element . '>';
                break;
        }

        return $html;
    }
956129
private JSONObject getNodeConfig() {
    JSONObject res = new JSONObject();
    try {
      res.put("class", "org.openqa.grid.common.RegistrationRequest");
      res.put("configuration", getConfiguration());
      JSONArray caps = new JSONArray();
      JSONArray devices = driver.getSupportedDevices();
      for (int i = 0; i < devices.length(); i++) {
        JSONObject device = (JSONObject) devices.get(i);
        for (int x = 0; x < driver.getSupportedApps().length(); x++) {
          caps.put(getDeviceConfig(device, driver.getSupportedApps().getJSONObject(x)));
        }
      }
      res.put("capabilities", caps);
    } catch (JSONException e) {
      throw new SelendroidException(e.getMessage(), e);
    }
    return res;
  }
1158130
public Map<String, Object> getDebugInfo()
  {
    Preconditions.checkArgument(lifecycleLock.awaitStarted(1, TimeUnit.MILLISECONDS));

    Map<String, Object> result = new HashMap<>(workers.size());
    for (Map.Entry<String, WorkerHolder> e : workers.entrySet()) {
      WorkerHolder serverHolder = e.getValue();
      result.put(
          e.getKey(),
          serverHolder.getUnderlyingSyncer().getDebugInfo()
      );
    }
    return result;
  }
636253
private GridHubConfiguration getHubConfiguration() throws Exception {
    String hubApi =
        "http://" + registrationRequest.getConfiguration().getHubHost() + ":"
        + registrationRequest.getConfiguration().getHubPort() + "/grid/api/hub";

    URL api = new URL(hubApi);
    HttpClient client = httpClientFactory.createClient(api);
    String url = api.toExternalForm();
    HttpRequest request = new HttpRequest(GET, url);

    HttpResponse response = client.execute(request);
    try (Reader reader = new StringReader(response.getContentString());
         JsonInput jsonInput = new Json().newInput(reader)) {
      return GridHubConfiguration.loadFromJSON(jsonInput);
    }
  }
1111366
protected function getConfiguration()
    {
        return array(
            'minHeight' => 200,
            'toolbar' => array(),
            'buttons' => array('html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'image', 'video', 'file', 'table', 'link', '|', 'alignment', '|', 'horizontalrule'),
            'buttonsAdd' => array(),
            'formattingTags' => array('p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4'),
            'buttonSource' => true,
            'iframe' => false,
            'fullpage' => false,
            'css' => false,
            'focus' => false,
            'shortcuts' => true,
            'autoresize' => true,
            'cleanup' => true,
            'toolbarFixed' => false,
            'toolbarFixedTopOffset' => 0,
            'toolbarFixedBox' => false,
            'toolbarFixedTarget' => 'document',
            'paragraphy' => true,
            'convertLinks' => true,
            'convertDivs' => true,
            'autosave' => false,
            'autosaveInterval' => 60,
            'modalOverlay' => true,
            'tabindex' => false,
            'observeImages' => true,
            'air' => false,
            'airButtons' => array('formatting', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent'),
            'wym' => false,
            'mobile' => true,
            'linkProtocol' => 'http://',
            'placeholder' => false,
            'linebreaks' => false,
            'allowedTags' => false,
            'deniedTags' => array('html', 'head', 'link', 'body', 'meta', 'script', 'style', 'applet'),
            'boldTag' => 'strong',
            'italicTag' => 'em',
            'linkEmail' => false,
            'linkAnchor' => false,
            'formattingPre' => false,
            'phpTags' => false,
            'visual' => true,
            's3' => false,
            'tabFocus' => true,
            'removeEmptyTags' => true,
            'convertImageLinks' => false,
            'convertVideoLinks' => false,
            'pastePlainText' => false,
            'linkNoFollow' => false,
            'clipboardUpload' => true,
            'dragUpload' => true,
            'tidyHtml' => false,
            'imageFloatMargin' => '10px',
            'tabSpaces' => false,
            'observeLinks' => false,
            'plugins' => array(),
        );
    }
720017
protected function getConfig()
    {
        $buttons = implode(',', $this->getConfigButtons());

        $blockformats = array(
            'p',
            'blockquote',
            'pre',
            'h1',
            'h2',
            'h3',
            'h4',
            'h5',
            'h6'
        );

        $blockformats = implode(',', $blockformats);

        $modes = $this->modes_enabled ? 'yes' : 'no';
        $image_server = $this->image_server ? $this->image_server : '';

        $config = array(
            'mode' => 'exact',
            'elements' => $this->id,
            'theme' => 'advanced',
            'theme_advanced_buttons1' => $buttons,
            'theme_advanced_buttons2' => '',
            'theme_advanced_buttons3' => '',
            'theme_advanced_toolbar_location' => 'top',
            'theme_advanced_toolbar_align' => 'left',
            'theme_advanced_blockformats' => $blockformats,
            'skin' => 'swat',
            'plugins' => 'swat,media,paste',
            'swat_modes_enabled' => $modes,
            'swat_image_server' => $image_server,
            'paste_remove_spans' => true,
            'paste_remove_styles' => true
        );

        return $config;
    }
1218612
private function getHtmlBeginning()
	{
		$html = '<' . $this->tagName;

		foreach ($this->attributes as $name => $value) {
			$html .= ' ' . $name . '="' . htmlspecialchars($value) . '"';
		}

		return $html;
	}
546280
@Override
    public Map<String, Object> getTuningConfig() {
        return ImmutableMap.<String, Object>of(
                "type", "hadoop",
                "partitionsSpec", partitionsSpec.getDataMap());
    }
534476
protected Content getNavLinkHelp() {
        String helpfile = configuration.helpfile;
        DocPath helpfilenm;
        if (helpfile.isEmpty()) {
            helpfilenm = DocPaths.HELP_DOC;
        } else {
            DocFile file = DocFile.createFileForInput(configuration, helpfile);
            helpfilenm = DocPath.create(file.getName());
        }
        Content linkContent = getHyperLink(pathToRoot.resolve(helpfilenm),
                helpLabel, "", "");
        Content li = HtmlTree.LI(linkContent);
        return li;
    }
31293
public String toHttpString() {
        StringBuilder sb = new StringBuilder();

        sb.append(getHttpVerb()).append(' ').append(getHttpURI()).append(' ')
                .append(getHttpVersion()).append(HttpProxyConstants.CRLF);

        boolean hostHeaderFound = false;

        if (getHeaders() != null) {
            for (Map.Entry<String, List<String>> header : getHeaders()
                    .entrySet()) {
                if (!hostHeaderFound) {
                    hostHeaderFound = header.getKey().equalsIgnoreCase("host");
                }

                for (String value : header.getValue()) {
                    sb.append(header.getKey()).append(": ").append(value)
                            .append(HttpProxyConstants.CRLF);
                }
            }

            if (!hostHeaderFound
                    && getHttpVersion() == HttpProxyConstants.HTTP_1_1) {
                sb.append("Host: ").append(getHost()).append(
                        HttpProxyConstants.CRLF);
            }
        }

        sb.append(HttpProxyConstants.CRLF);

        return sb.toString();
    }
154396
public String outerHtml() {
        StringBuilder accum = StringUtil.borrowBuilder();
        outerHtml(accum);
        return StringUtil.releaseBuilder(accum);
    }
1340597
public final String dumpConfiguration() {
    if (properties.isEmpty())
      return "No configuration settings stored";

    StringBuilder response = new StringBuilder("TSD Configuration:\n");
    response.append("File [" + config_location + "]\n");
    int line = 0;
    for (Map.Entry<String, String> entry : properties.entrySet()) {
      if (line > 0) {
        response.append("\n");
      }
      response.append("Key [" + entry.getKey() + "]  Value [");
      if (entry.getKey().toUpperCase().contains("PASS")) {
         response.append("********");
      } else {
        response.append(entry.getValue());
      }
      response.append("]");
      line++;
    }
    return response.toString();
  }
750227
public function renderDebug()
    {
        $html = '';
        foreach (static::DEBUG_ELEMENTS as $element) {
            $html .= $this->consoleLog('"Checking element binding of ' . $element . '..."');
            $html .= $this->consoleLog($element . '!==undefined');
        }

        return $html;
    }