Changeset 32270 for main


Ignore:
Timestamp:
2018-07-12T18:52:25+12:00 (6 years ago)
Author:
ak19
Message:

Adding in a handy utility function to see the call stack by printing out the stacktrace even when there's no exception object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r31582 r32270  
    9595    }
    9696
     97    /**
     98     * Handy function to display the list of calling functions by
     99     * printing out the stack trace even when you don't have an exception
     100     */
     101    static public void printStackTrace() {
     102    // https://stackoverflow.com/questions/1069066/get-current-stack-trace-in-java
     103    //new Exception().printStackTrace();
     104    //StackTraceElement[] el = Thread.currentThread().getStackTrace();
     105    System.err.println("\n@@@@ stacktrace:\n" + Arrays.toString(Thread.currentThread().getStackTrace()) + "\n");
     106    }
     107   
    97108    /**
    98109     * Reads in a text file and returns the contents as a String
Note: See TracChangeset for help on using the changeset viewer.