Show messages from Google Closure Compiler.
Messages can be tuned on/off by adjusting the `output_info` setting
@param {Object} json
@private
322287
function(json) {
        var stats, shaved, kb;

        this._showOutputDebug(json.warnings, 'warning', this.console.warn);
        this._showOutputDebug(json.errors, 'error', this.console.error);

        if (json.statistics) {

            stats = json.statistics;
            shaved = (100 - (stats.compressedSize / stats.originalSize * 100)).toPrecision(3);
            kb = function(bytes) {
                return Math.round(bytes / 10.24) / 100 + ' KB';
            };

            this.console.info();
            this.console.info('      Original', kb(stats.originalSize));
            this.console.info('    Compressed', kb(stats.compressedSize));
            this.console.info('     + GZipped', kb(stats.compressedGzipSize));
            this.console.info('       Reduced', shaved + '%');
            this.console.info();
        }
    }
785013
private void extractMessage(JsonObject object) {
        // Prefer to pull the message out of meta
        JsonObject meta = object.getAsJsonObject("meta");
        if (meta != null) {
            JsonPrimitive msg = meta.getAsJsonPrimitive("msg");
            if (msg != null) {
                this.message = msg.getAsString();
                return;
            }
        }

        // Fall back on error
        JsonPrimitive error = object.getAsJsonPrimitive("error");
        if (error != null) {
            this.message = error.getAsString();
            return;
        }

        // Otherwise set a default
        this.message = "Unknown Error";
    }
247321
function json2html(json, options) {
    var html = '';
    if (typeof json === 'string') {
      // Escape tags
      json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
      if (options.withLinks && isUrl(json)) {
        html += '<a href="' + json + '" class="json-string" target="_blank">' + json + '</a>';
      } else {
        html += '<span class="json-string">"' + json + '"</span>';
      }
    } else if (typeof json === 'number') {
      html += '<span class="json-literal">' + json + '</span>';
    } else if (typeof json === 'boolean') {
      html += '<span class="json-literal">' + json + '</span>';
    } else if (json === null) {
      html += '<span class="json-literal">null</span>';
    } else if (json instanceof Array) {
      if (json.length > 0) {
        html += '[<ol class="json-array">';
        for (var i = 0; i < json.length; ++i) {
          html += '<li>';
          // Add toggle button if item is collapsable
          if (isCollapsable(json[i])) {
            html += '<a href class="json-toggle"></a>';
          }
          html += json2html(json[i], options);
          // Add comma if item is not last
          if (i < json.length - 1) {
            html += ',';
          }
          html += '</li>';
        }
        html += '</ol>]';
      } else {
        html += '[]';
      }
    } else if (typeof json === 'object') {
      var key_count = Object.keys(json).length;
      if (key_count > 0) {
        html += '{<ul class="json-dict">';
        for (var key in json) {
          if (json.hasOwnProperty(key)) {
            html += '<li>';
            var keyRepr = options.withQuotes ?
              '<span class="json-string">"' + key + '"</span>' : key;
            // Add toggle button if item is collapsable
            if (isCollapsable(json[key])) {
              html += '<a href class="json-toggle">' + keyRepr + '</a>';
            } else {
              html += keyRepr;
            }
            html += ': ' + json2html(json[key], options);
            // Add comma if item is not last
            if (--key_count > 0) {
              html += ',';
            }
            html += '</li>';
          }
        }
        html += '</ul>}';
      } else {
        html += '{}';
      }
    }
    return html;
  }
272520
function parseMessage(msg, jsonEncode) {
    if (typeof msg === 'string') {
        msg = { data: msg };
    }

    var output = '';
    if (msg.event) {
        output += 'event: ' + msg.event + '\n';
    }

    if (msg.retry) {
        output += 'retry: ' + msg.retry + '\n';
    }

    if (msg.id) {
        output += 'id: ' + msg.id + '\n';
    }

    var data = msg.data || '';
    if (jsonEncode) {
        data = JSON.stringify(data);
    }

    output += parseTextData(data);

    return output;
}
1329989
public void dumpJson(final PrintWriter out) {
        out.append("{");
        visitVariables(new Visitor() {
            int count = 0;

            public void visit(Variable var) {
                if (count++ > 0) { out.append(", "); }
                out.append(var.getName()).append("='").append(String.valueOf(var.getValue())).append("'");
            }
        });
        out.append("}");
    }
1261475
function(json) {
      var decoder = AV.Op._opDecoderMap[json.__op];
      if (decoder) {
        return decoder(json);
      } else {
        return undefined;
      }
    }
463893
function ( arg, target ) {
		var ts, msg;

		if ( typeof console !== "undefined" ) {
			ts  = typeof arg !== "object";
			msg = ts ? "[" + new Date().toLocaleTimeString() + "] " + arg : arg;
			console[target || "log"]( msg );
		}
	}
366873
function _parseMessage() {
    let message = [].slice.call(arguments).join("|");
    try {
        message = (typeof message === "string") ? message : JSON.stringify(message);
    } catch(e) {
        logger.error(e.stack);
    }

    return message;
}
890501
function readJson(file) {
  return when(
    readText(file),
    function(result) {
      try {
        return JSON.parse(result);
      } catch (e) {
        if (e instanceof SyntaxError) {
          return json5.parse(result);
        } else {
          throw e;
        }
      }
    },
    function(e) {
      throw e;
    }
  );
}
227291
private void toJSON(JSONEmitter json) {
        switch (m_type) {
        case ARRAY:
            json.startArray(m_name);
            if (m_children != null) {
                for (UNode childNode : m_children) {
                    if (childNode.isMap()) {
                        json.startObject();
                        childNode.toJSON(json);
                        json.endObject();
                    } else {
                        childNode.toJSON(json);
                    }
                }
            }
            json.endArray();
            break;
            
        case MAP:
            // Return map child modes in name order.
            json.startGroup(m_name);
            if (m_childNodeMap != null) {
                assert m_childNodeMap.size() == m_children.size();
                for (UNode childNode : m_childNodeMap.values()) {
                    childNode.toJSON(json);
                }
            }
            json.endGroup();
            break;
            
        case VALUE:
            if (m_bAltFormat && m_tagName != null) {
                // Generate as "<tag>: {"<name>": "<value>"}
                json.startGroup(m_tagName);
                json.addValue(m_name, m_value);
                json.endGroup();
            } else if (m_parent != null && m_parent.isArray()) {
                if (m_name.equals("value")) {
                    // nameless node: "<value>"
                    json.addValue(m_value);
                } else {
                    // value as an object: {"name": "value"}
                    json.addObject(m_name, m_value);
                }
            } else {
                // Simple case: "<name>": "<value>"
                json.addValue(m_name, m_value);
            }
            break;
            
        default:
            assert false : "Unknown NodeType: " + m_type;
        }
    }
302794
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof Event)){
    return new Event(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(Event.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
767495
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof SourceDescription)){
    return new SourceDescription(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(SourceDescription.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
283756
function JSONMinifier() {
  const self = this;
  self.process = ({ output }) => JSON.stringify(JSON.parse(output));
}
567705
function evalheaders(json, type) {
		var id = json.$originalid || json.$instanceid;
		delete json.$instanceid;
		delete json.$originalid;
		if (id) {
			Object.defineProperty(type, "$originalid", gui.Property.nonenumerable({
				value: id
			}));
		}
	}
554538
function(json, options) {
	var indent = options.asText == 'pretty' ? '\t' : null;
	if (options.javascript) {
		return util.js.stringify(json, indent);
	}
	else {
		return JSON.stringify(json, null, indent);
	}
}
47860
function onPage(output, page) {
    var file = page.getFile();
    var readme = output.getBook().getReadme().getFile();

    return Modifiers.modifyHTML(page, getModifiers(output, page))
    .then(function(resultPage) {
        // Generate the JSON
        var json = JSONUtils.encodeBookWithPage(output.getBook(), resultPage);

        // Delete some private properties
        delete json.config;

        // Specify JSON output version
        json.version = JSON_VERSION;

        // File path in the output folder
        var filePath = file.getPath() == readme.getPath()? 'README.json' : file.getPath();
        filePath = PathUtils.setExtension(filePath, '.json');

        // Write it to the disk
        return writeFile(
            output,
            filePath,
            JSON.stringify(json, null, 4)
        );
    });
}
661182
function gotResults(results) {
  results.JSONquery = JSON.stringify(results.query, null, 2);
  console.log('gotResults', results);
  updateResults(results);
}