Examples of DebugTrace


Examples of railo.runtime.debug.DebugTrace

      }
     
     
     
    }
    DebugTrace trace = pageContext.getDebugger().addTrace(type,category,text,page,var,varValue);
    DebugTrace[] traces = ((DebuggerPro)pageContext.getDebugger()).getTraces(pageContext);
   
    String total="(1st trace)";
    if(traces.length>1) {
      long t=0;
      for(int i=0;i<traces.length;i++) {
        t+=traces[i].getTime();
      }
      total="("+t+")";
    }
   
    boolean hasCat=!StringUtil.isEmpty(trace.getCategory());
    boolean hasText=!StringUtil.isEmpty(trace.getText());
    boolean hasVar=!StringUtil.isEmpty(var);
   
    // inline
    if(inline) {
      railo.runtime.format.TimeFormat tf = new railo.runtime.format.TimeFormat(pageContext.getConfig().getLocale());
      StringBuffer sb=new StringBuffer();
      sb.append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"white\">");
      sb.append("<tr>");
      //sb.append("<td><img src=\"/CFIDE/debug/images/Error_16x16.gif\" alt=\"Error type\">");
      sb.append("<td>");
      sb.append("<font color=\"orange\">");
      sb.append("<b>");
      sb.append(LogUtil.toStringType(trace.getType(),"INFO")+" - ");
      sb.append("[CFTRACE "+tf.format(new DateTimeImpl(pageContext.getConfig()), "hh:mm:ss:l")+"]");
      sb.append("["+trace.getTime()+" ms "+total+"]");
      sb.append("["+trace.getTemplate()+" @ line: "+trace.getLine()+"]");
      if(hasCat || hasText)sb.append(" -");
      if(hasCat)sb.append("  ["+trace.getCategory()+"]");
      if(hasText)sb.append(" <i>"+trace.getText()+"&nbsp;</i>");
      sb.append("</b>");
      sb.append("</font>");
      sb.append("</td>");
      sb.append("</tr>");
      sb.append("</table>");
      pageContext.forceWrite(sb.toString());
     
      if(hasVar)Dump.call(pageContext, value, var);
     
    }
   
    // log
    LogAndSource log = pageContext.getConfig().getTraceLogger();
    StringBuffer msg=new StringBuffer();
    msg.append("["+trace.getTime()+" ms "+total+"] ");
    msg.append("["+trace.getTemplate()+" @ line: "+trace.getLine()+"]");
    if(hasCat || hasText || hasVar) msg.append("- ");
    if(hasCat)msg.append("["+trace.getCategory()+"] ");
    if(hasVar)msg.append("["+var+"="+varValue+"] ");
    if(hasText)msg.append(" "+trace.getText()+" ");
    log.log(trace.getType(), "cftrace", msg.toString());
   
    // abort
    if(abort) throw new Abort(Abort.SCOPE_REQUEST);
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.