- plugin functionality added

- Logging adapted to use the .configure property file

git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@178 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
schlaepfer
2006-10-20 15:00:56 +00:00
parent 36c42b4f2c
commit b97aba3961
12 changed files with 110 additions and 74 deletions

View File

@@ -1,9 +1,9 @@
package ch.ntb.usb;
import java.util.logging.Level;
import java.util.logging.Logger;
import ch.ntb.usb.logger.LogUtil;
import ch.ntb.usb.logger.UsbLogger;
/**
* This class represents an USB device.<br>
@@ -14,7 +14,7 @@ import ch.ntb.usb.logger.UsbLogger;
*/
public class Device {
private static UsbLogger logger = LogUtil.ch_ntb_usb;
private static Logger logger = LogUtil.getLogger("ch.ntb.usb");
private static final int TIMEOUT_ERROR_CODE = -116;
@@ -224,7 +224,8 @@ public class Device {
+ LibusbWin.usb_strerror());
}
if (logger.getLevel().intValue() <= Level.INFO.intValue()) {
logger.info("length written: " + lenWritten);
if (logger.getLevel().intValue() <= Level.FINEST.intValue()) {
StringBuffer sb = new StringBuffer("bulkwrite, ep 0x"
+ Integer.toHexString(out_ep_address) + ": " + lenWritten
+ " Bytes sent: ");
@@ -283,7 +284,8 @@ public class Device {
+ LibusbWin.usb_strerror());
}
if (logger.getLevel().intValue() <= Level.INFO.intValue()) {
logger.info("length read: " + lenRead);
if (logger.getLevel().intValue() <= Level.FINEST.intValue()) {
StringBuffer sb = new StringBuffer("bulkread, ep 0x"
+ Integer.toHexString(in_ep_address) + ": " + lenRead
+ " Bytes received: ");
@@ -343,7 +345,8 @@ public class Device {
+ LibusbWin.usb_strerror());
}
if (logger.getLevel().intValue() <= Level.INFO.intValue()) {
logger.info("length written: " + lenWritten);
if (logger.getLevel().intValue() <= Level.FINEST.intValue()) {
StringBuffer sb = new StringBuffer("bulkwrite, ep 0x"
+ Integer.toHexString(out_ep_address) + ": " + lenWritten
+ " Bytes sent: ");
@@ -403,7 +406,8 @@ public class Device {
+ LibusbWin.usb_strerror());
}
if (logger.getLevel().intValue() <= Level.INFO.intValue()) {
logger.info("length read: " + lenRead);
if (logger.getLevel().intValue() <= Level.FINEST.intValue()) {
StringBuffer sb = new StringBuffer("bulkread, ep 0x"
+ Integer.toHexString(in_ep_address) + ": " + lenRead
+ " Bytes received: ");