Package com.dianping.cat.message

Examples of com.dianping.cat.message.Trace


    for (int i = 0; i < 10; i++) {
      Transaction t = Cat.newTransaction("Trace", "Test"+i);
      try {
        Cat.logTrace("Trace", "Info");
        Cat.logTrace("Trace", "Dubug", Trace.SUCCESS, "sss");
        Trace trace = Cat.newTrace("Trace", "Error");

        trace.setStatus(Trace.SUCCESS);
        trace.addData("errorTrace");
        t.setStatus("Fail");
      } catch (Exception e) {
        t.setStatus(Transaction.SUCCESS);
        Cat.logError(e);
        throw e;
View Full Code Here


  }

  @Test
  public void testTrace() {
    long timestamp = 1325489621987L;
    Trace trace = newTrace("type", "name", timestamp, "0", "here is the data.");

    check(trace, "L2012-01-02 15:33:41.987\ttype\tname\t0\there is the data.\t\n");
  }
View Full Code Here

  @Test
  public void testTraceForRawData() {
    long timestamp = 1325489621987L;
    String exception = "java.lang.Exception\n\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testTraceForException(PlainTextMessageCodecTest.java:112)\n";
    Trace trace = newTrace("Exception", Exception.class.getName(), timestamp, "ERROR", exception);

    check(trace,
          "L2012-01-02 15:33:41.987\tException\tjava.lang.Exception\tERROR\t" + //
                "java.lang.Exception\\n\\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testTraceForException(PlainTextMessageCodecTest.java:112)\\n\t\n");
  }
View Full Code Here

  }

  @Override
  public void logTrace(String type, String name, String status, String nameValuePairs) {
    if (m_manager.isTraceMode()) {
      Trace trace = newTrace(type, name);

      if (nameValuePairs != null && nameValuePairs.length() > 0) {
        trace.addData(nameValuePairs);
      }

      trace.setStatus(status);
      trace.complete();
    }
  }
View Full Code Here

  }

  @Test
  public void testTrace() throws Exception {
    long timestamp = 1325489621987L;
    Trace trace = newTrace("type", "name", timestamp, "0", "here is the data.");

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(trace);
    check(tree, trace,
          "<tr><td>L15:33:41.987</td><td>type</td><td>name</td><td>&nbsp;</td><td>here is the data.</td></tr>\r\n");
View Full Code Here

  public void testTraceForRawData() throws Exception {
    long timestamp = 1325489621987L;
    String exception = "java.lang.Exception\n"
          + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testTraceForException(PlainTextMessageCodecTest.java:112)\n"
          + "\tat com.dianping.cat.message.spi.codec.PlainTextMessageCodecTest.testTraceForException(PlainTextMessageCodecTest.java:108)\n";
    Trace trace = newTrace("Exception", Exception.class.getName(), timestamp, "ERROR", exception);

    MessageTree tree = new DefaultMessageTree();
    tree.setMessage(trace);
    check(tree,
          trace,
View Full Code Here

TOP

Related Classes of com.dianping.cat.message.Trace

Copyright © 2018 www.massapicom. 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.