[libbluray-devel] Improved logging of BDJLoader and BDJAppProxy failures

hpi1 git at videolan.org
Tue Jun 11 15:15:55 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Jun 11 11:16:50 2013 +0300| [cb0c429ced5af9a26f845d7674c27700b8693bb8] | committer: hpi1

Improved logging of BDJLoader and BDJAppProxy failures

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

 src/libbluray/bdj/java/org/videolan/BDJAppProxy.java |    7 +++++++
 src/libbluray/bdj/java/org/videolan/BDJLoader.java   |    5 +++++
 2 files changed, 12 insertions(+)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java b/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java
index 9829223..7bab567 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJAppProxy.java
@@ -183,6 +183,7 @@ public class BDJAppProxy implements DVBJProxy, Runnable {
                 state = LOADED;
                 return true;
             } catch (Throwable e) {
+                logger.error("doLoad() failed: " + e);
                 e.printStackTrace();
                 state = INVALID;
             }
@@ -203,6 +204,7 @@ public class BDJAppProxy implements DVBJProxy, Runnable {
                 state = PAUSED;
                 return true;
             } catch (Throwable e) {
+                logger.error("doInit() failed: " + e);
                 e.printStackTrace();
                 state = INVALID;
             }
@@ -221,6 +223,7 @@ public class BDJAppProxy implements DVBJProxy, Runnable {
                 state = STARTED;
                 return true;
             } catch (Throwable e) {
+                logger.error("doStart() failed: " + e);
                 e.printStackTrace();
                 state = INVALID;
             }
@@ -246,6 +249,7 @@ public class BDJAppProxy implements DVBJProxy, Runnable {
                     new File(persistent).delete();
                 }
             } catch (Throwable e) {
+                logger.error("doStop() failed: " + e);
                 e.printStackTrace();
                 state = INVALID;
                 return false;
@@ -263,6 +267,7 @@ public class BDJAppProxy implements DVBJProxy, Runnable {
                 state = PAUSED;
                 return true;
             } catch (Throwable e) {
+                logger.error("doPause() failed: " + e);
                 e.printStackTrace();
                 state = INVALID;
             }
@@ -277,6 +282,7 @@ public class BDJAppProxy implements DVBJProxy, Runnable {
                 state = STARTED;
                 return true;
             } catch (Throwable e) {
+                logger.error("doResume() failed: " + e);
                 e.printStackTrace();
                 state = INVALID;
             }
@@ -356,6 +362,7 @@ public class BDJAppProxy implements DVBJProxy, Runnable {
     private LinkedList listeners = new LinkedList();
     private LinkedList cmds = new LinkedList();
     private Thread thread;
+    private static final Logger logger = Logger.getLogger(BDJAppProxy.class.getName());
 
     private class AppCommand {
         public AppCommand(int cmd, Object arg) {
diff --git a/src/libbluray/bdj/java/org/videolan/BDJLoader.java b/src/libbluray/bdj/java/org/videolan/BDJLoader.java
index 8f77242..8905197 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJLoader.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJLoader.java
@@ -50,6 +50,7 @@ public class BDJLoader {
             BDLocator locator = new BDLocator(null, title, -1);
             return load((TitleImpl)(SIManager.createInstance().getService(locator)), restart, callback);
         } catch (Throwable e) {
+            logger.error("load() failed: " + e);
             e.printStackTrace();
             return false;
         }
@@ -59,6 +60,7 @@ public class BDJLoader {
         try {
             return load((TitleImpl)(SIManager.createInstance().getService(locator)), restart, callback);
         } catch (Throwable e) {
+            logger.error("load() failed: " + e);
             e.printStackTrace();
             return false;
         }
@@ -93,6 +95,7 @@ public class BDJLoader {
         try {
             queue.finalize();
         } catch (Throwable e) {
+            logger.error("shutdown() failed: " + e);
             e.printStackTrace();
         }
     }
@@ -198,6 +201,7 @@ public class BDJLoader {
             return true;
 
         } catch (Throwable e) {
+            logger.error("loadN() failed: " + e);
             e.printStackTrace();
             unloadN();
             return false;
@@ -220,6 +224,7 @@ public class BDJLoader {
 
             return true;
         } catch (Throwable e) {
+            logger.error("unloadN() failed: " + e);
             e.printStackTrace();
             return false;
         }



More information about the libbluray-devel mailing list