Search in sources :

Example 31 with SimpleDumpData

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;
}
Also used : Struct(lucee.runtime.type.Struct) DumpTable(lucee.runtime.dump.DumpTable) Array(lucee.runtime.type.Array) Key(lucee.runtime.type.Collection.Key) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) Collection(lucee.runtime.type.Collection) Key(lucee.runtime.type.Collection.Key)

Example 32 with SimpleDumpData

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;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 33 with SimpleDumpData

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;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) DateTimeImpl(lucee.runtime.type.dt.DateTimeImpl)

Example 34 with SimpleDumpData

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;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Example 35 with SimpleDumpData

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;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) SimpleDumpData(lucee.runtime.dump.SimpleDumpData)

Aggregations

DumpTable (lucee.runtime.dump.DumpTable)39 SimpleDumpData (lucee.runtime.dump.SimpleDumpData)39 DumpData (lucee.runtime.dump.DumpData)5 PageException (lucee.runtime.exp.PageException)4 Collection (lucee.runtime.type.Collection)4 Key (lucee.runtime.type.Collection.Key)4 DumpRow (lucee.runtime.dump.DumpRow)3 PageRuntimeException (lucee.runtime.exp.PageRuntimeException)3 Struct (lucee.runtime.type.Struct)3 IOException (java.io.IOException)2 Iterator (java.util.Iterator)2 Binding (javax.wsdl.Binding)2 BindingOperation (javax.wsdl.BindingOperation)2 Operation (javax.wsdl.Operation)2 Port (javax.wsdl.Port)2 QName (javax.xml.namespace.QName)2 DumpProperties (lucee.runtime.dump.DumpProperties)2 DumpWriter (lucee.runtime.dump.DumpWriter)2 ExpressionException (lucee.runtime.exp.ExpressionException)2 Array (lucee.runtime.type.Array)2