- output a warning instead of an exception if the properties file .configure can not be found
git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@207 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -18,6 +18,9 @@ public class LogUtil {
|
||||
|
||||
private static final String PLUGIN_ID = "ch.ntb.usb";
|
||||
private static final String PROPERTIES_FILE = ".configure";
|
||||
private static final String LOGGER_WARNING = "Warning in class "
|
||||
+ LogUtil.class.getName()
|
||||
+ ": could not load the logger properties file " + PROPERTIES_FILE;
|
||||
|
||||
private static boolean debugEnabled;
|
||||
|
||||
@@ -62,7 +65,9 @@ public class LogUtil {
|
||||
try {
|
||||
InputStream is = LogUtil.class.getClassLoader()
|
||||
.getResourceAsStream(PROPERTIES_FILE);
|
||||
// FileInputStream fis = new FileInputStream();
|
||||
if (is == null) {
|
||||
System.err.println(LOGGER_WARNING);
|
||||
} else {
|
||||
Properties prop = new Properties();
|
||||
prop.load(is);
|
||||
// get global debug enable flag
|
||||
@@ -95,6 +100,7 @@ public class LogUtil {
|
||||
moreLoggers = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user