[libbluray-devel] Improved stack dump in Logger.unimplemented()

hpi1 git at videolan.org
Thu Feb 7 22:40:02 CET 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Feb  7 22:56:33 2013 +0200| [2cb2ccb9bb56d54fa9f58a98789426cabc84a911] | committer: hpi1

Improved stack dump in Logger.unimplemented()

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=2cb2ccb9bb56d54fa9f58a98789426cabc84a911
---

 src/libbluray/bdj/java/org/videolan/Logger.java |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/Logger.java b/src/libbluray/bdj/java/org/videolan/Logger.java
index 6d948ba..cdd4cb1 100644
--- a/src/libbluray/bdj/java/org/videolan/Logger.java
+++ b/src/libbluray/bdj/java/org/videolan/Logger.java
@@ -70,13 +70,19 @@ public class Logger {
         unimplemented(null);
     }
 
+    public static void dumpStack() {
+        java.lang.StackTraceElement e[] = java.lang.Thread.currentThread().getStackTrace();
+        for (int i = 2; i < e.length; i++)
+            log("    " + e[i].toString());
+    }
+
     public void unimplemented(String func) {
         String location = name;
         if (func != null) {
             location = location + "." + func + "()";
             log("BD-J: Not implemented: " + location);
         }
-        Thread.dumpStack();
+        dumpStack();
 
         if (use_throw) {
             throw new Error("Not implemented: " + location);
@@ -87,7 +93,7 @@ public class Logger {
         String location = cls + "." + func + "()";
         log("BD-J: Not implemented: " + location);
 
-        Thread.dumpStack();
+        dumpStack();
 
         if (use_throw) {
             throw new Error("Not implemented: " + location);



More information about the libbluray-devel mailing list