private void writeDebug() throws JsonGenerationException, IOException { if (debugInfo != null) { writer.writeFieldName("debug"); writer.writeStartObject(); writer.writeStringField("script-version", debugInfo.getScriptVersion()); List<LoadDescription> descriptions = debugInfo.getDescriptions(); List<QueryData> queries = debugInfo.getQueries(); for (int index = 0; index < descriptions.size(); index++) { writer.writeFieldName("query_" + index); writer.writeStartObject(); LoadDescription description = descriptions.get(index); OrcsSession session = description.getSession(); if (session != null) { writer.writeStringField("session", session.getGuid()); } Options options = description.getOptions(); for (String key : new TreeSet<String>(options.getKeys())) { writer.writeStringField(key, options.get(key).replaceAll("\\s+", " ")); } writeQuery(queries.get(index)); writer.writeEndObject(); } writer.writeEndObject(); } }
@Override public void onLoadDescription(LoadDescription data) throws OseeCoreException { super.onLoadDescription(data); first = Iterables.getFirst(data.getObjectDescription().getDynamicData(), null); wasStarted = false; if (debugInfo != null) { debugInfo.addDescription(data); } }