use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class PageExceptionImpl method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
// FFFFCF
DumpTable htmlBox = new DumpTable("exception", "#ff9900", "#FFCC00", "#000000");
htmlBox.setTitle(Constants.NAME + " [" + pageContext.getConfig().getFactory().getEngine().getInfo().getVersion() + "] - Error (" + StringUtil.ucFirst(getTypeAsString()) + ")");
// Message
htmlBox.appendRow(1, new SimpleDumpData("Message"), new SimpleDumpData(getMessage()));
// Detail
String detail = getDetail();
if (!StringUtil.isEmpty(detail, true))
htmlBox.appendRow(1, new SimpleDumpData("Detail"), new SimpleDumpData(detail));
// additional
Iterator<Key> it = additional.keyIterator();
Collection.Key k;
while (it.hasNext()) {
k = it.next();
htmlBox.appendRow(1, new SimpleDumpData(k.getString()), new SimpleDumpData(additional.get(k, "").toString()));
}
Array tagContext = getTagContext(pageContext.getConfig());
// Context MUSTMUST
if (tagContext.size() > 0) {
// Collection.Key[] keys=tagContext.keys();
Iterator<Object> vit = tagContext.valueIterator();
// Entry<Key, Object> te;
DumpTable context = new DumpTable("#ff9900", "#FFCC00", "#000000");
// context.setTitle("The Error Occurred in");
// context.appendRow(0,new SimpleDumpData("The Error Occurred in"));
context.appendRow(7, new SimpleDumpData(""), new SimpleDumpData("template"), new SimpleDumpData("line"));
try {
boolean first = true;
while (vit.hasNext()) {
Struct struct = (Struct) vit.next();
context.appendRow(1, new SimpleDumpData(first ? "called from " : "occurred in"), new SimpleDumpData(struct.get(KeyConstants._template, "") + ""), new SimpleDumpData(Caster.toString(struct.get(KeyConstants._line, null))));
first = false;
}
htmlBox.appendRow(1, new SimpleDumpData("Context"), context);
// Code
String strCode = ((Struct) tagContext.get(1, null)).get(KeyConstants._codePrintPlain, "").toString();
String[] arrCode = ListUtil.listToStringArray(strCode, '\n');
arrCode = ListUtil.trim(arrCode);
DumpTable code = new DumpTable("#ff9900", "#FFCC00", "#000000");
for (int i = 0; i < arrCode.length; i++) {
code.appendRow(i == 2 ? 1 : 0, new SimpleDumpData(arrCode[i]));
}
htmlBox.appendRow(1, new SimpleDumpData("Code"), code);
} catch (PageException e) {
}
}
// Java Stacktrace
String strST = getStackTraceAsString();
String[] arrST = ListUtil.listToStringArray(strST, '\n');
arrST = ListUtil.trim(arrST);
DumpTable st = new DumpTable("#ff9900", "#FFCC00", "#000000");
for (int i = 0; i < arrST.length; i++) {
st.appendRow(i == 0 ? 1 : 0, new SimpleDumpData(arrST[i]));
}
htmlBox.appendRow(1, new SimpleDumpData("Java Stacktrace"), st);
return htmlBox;
}
use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class DebugPageImpl method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
DumpTable table = new DumpTable("#cccc66", "#cccc99", "#000000");
table.setTitle(file.getAbsolutePath());
table.appendRow(1, new SimpleDumpData("min (ms)"), new SimpleDumpData(min));
table.appendRow(1, new SimpleDumpData("avg (ms)"), new SimpleDumpData(getAverageExecutionTime()));
table.appendRow(1, new SimpleDumpData("max (ms)"), new SimpleDumpData(max));
table.appendRow(1, new SimpleDumpData("total (ms)"), new SimpleDumpData(all));
return table;
}
use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class PageSourcePool method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
maxlevel--;
Iterator<PageSource> it = pageSources.values().iterator();
DumpTable table = new DumpTable("#FFCC00", "#FFFF00", "#000000");
table.setTitle("Page Source Pool");
table.appendRow(1, new SimpleDumpData("Count"), new SimpleDumpData(pageSources.size()));
while (it.hasNext()) {
PageSource ps = it.next();
DumpTable inner = new DumpTable("#FFCC00", "#FFFF00", "#000000");
inner.setWidth("100%");
inner.appendRow(1, new SimpleDumpData("source"), new SimpleDumpData(ps.getDisplayPath()));
inner.appendRow(1, new SimpleDumpData("last access"), DumpUtil.toDumpData(new DateTimeImpl(pageContext, ps.getLastAccessTime(), false), pageContext, maxlevel, dp));
inner.appendRow(1, new SimpleDumpData("access count"), new SimpleDumpData(ps.getAccessCount()));
table.appendRow(1, new SimpleDumpData("Sources"), inner);
}
return table;
}
use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class StaticScope method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
int access = c.getAccess(pageContext);
DumpTable table = new DumpTable("component", "#99cc99", "#ccffcc", "#000000");
table.setTitle("Static Scope from Component " + cp.getComponentName());
table.setComment("Only the functions and data members that are accessible from your location are displayed");
DumpTable content = _toDumpData(c.top, pageContext, maxlevel, dp, access);
if (!content.isEmpty())
table.appendRow(1, new SimpleDumpData(""), content);
return table;
}
use of lucee.runtime.dump.SimpleDumpData in project Lucee by lucee.
the class HTTPCacheItem method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties) {
DumpTable table = new DumpTable("#669999", "#ccffff", "#000000");
table.setTitle("HTTPCacheEntry");
table.appendRow(1, new SimpleDumpData("Output"), data.toDumpData(pageContext, maxlevel, properties));
if (url != null)
table.appendRow(1, new SimpleDumpData("URL"), DumpUtil.toDumpData(new SimpleDumpData(url), pageContext, maxlevel, properties));
return table;
}
Aggregations