Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/arranger/jarl/util/Debug.java


1   package com.arranger.jarl.util;
2   
3   /**
4    * Debug created on Feb 19, 2003
5    */
6   public class Debug {
7   
8       public static final int DEFAULT_STACK_DEPTH = 5;
9   
10      public static void debug(String message) {
11          System.out.println(message);
12      }
13  
14      public static void warn(String message) {
15          System.out.println(message);
16      }
17  
18      public static String getStackTrace(Throwable throwable) {
19          StackTraceUtil stackTraceUtil = new StackTraceUtil(throwable);
20  
21          StringBuffer buffer = new StringBuffer();
22          for (int index = 0; index < DEFAULT_STACK_DEPTH; index++) {
23              buffer.append(stackTraceUtil.location(index));
24              buffer.append("\r\n");
25          }
26  
27          buffer.append("...");
28          buffer.append("\r\n");
29  
30          return buffer.toString();
31      }
32  }