[libbluray-devel] Improved logging

hpi1 git at videolan.org
Tue Mar 11 14:55:52 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Mar 11 15:48:59 2014 +0200| [ff919cda7b1fcbe2d9bf12874d434e9b2abc844c] | committer: hpi1

Improved logging

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

 src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java |    4 ++++
 src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java |   10 ++++++++++
 src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java     |    4 +++-
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java b/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java
index b8b4ffc..b736f6b 100644
--- a/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java
+++ b/src/libbluray/bdj/java-j2me/org/videolan/PortingHelper.java
@@ -26,4 +26,8 @@ public class PortingHelper {
 
     public static void stopThreadGroup(ThreadGroup t) {
     }
+
+    public static String dumpStack(Thread t) {
+        return "";
+    }
 }
diff --git a/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java b/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java
index b416ec0..7cf40b1 100644
--- a/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java
+++ b/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java
@@ -28,4 +28,14 @@ public class PortingHelper {
     public static void stopThreadGroup(ThreadGroup t) {
         t.stop();
     }
+
+    public static String dumpStack(Thread t) {
+        String dump = "";
+        StackTraceElement e[] = t.getStackTrace();
+        if (e != null) {
+            for (int i = 0; i < e.length; i++)
+                dump += "\n\t" + e[i].toString();
+        }
+        return dump;
+    }
 }
diff --git a/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java b/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
index 550d443..1226446 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJThreadGroup.java
@@ -63,7 +63,7 @@ public class BDJThreadGroup extends ThreadGroup {
 
         boolean result = (activeCount() <= maxThreads);
         if (!result) {
-            logger.error("waitForShutdown timeout");
+            logger.error("waitForShutdown timeout (have " + activeCount() + " threads, expected " + maxThreads + ")");
         }
         return result;
     }
@@ -100,6 +100,8 @@ public class BDJThreadGroup extends ThreadGroup {
             if (threads[i] == null)
                 continue;
             logger.info("    " + threads[i]);
+            logger.info("   state " + threads[i].getState().toString());
+            logger.info("    at " + PortingHelper.dumpStack(threads[i]));
         }
     }
 



More information about the libbluray-devel mailing list