aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorendolf <[email protected]>2009-10-31 11:06:12 +0000
committerendolf <[email protected]>2009-10-31 11:06:12 +0000
commita75b5068d2d457fcfe96cce1dba51f5685581f31 (patch)
treea99605cd820faea6a9370c0b2ecbdb10a32af5d9 /plugins
parent6493ba6bc7e9900a5738c3f0f5e4c10795e4cd1e (diff)
Use java logging instead of system out in core and plugins.
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@229 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OSX/src/java/net/java/games/input/OSXHIDDevice.java16
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java9
2 files changed, 15 insertions, 10 deletions
diff --git a/plugins/OSX/src/java/net/java/games/input/OSXHIDDevice.java b/plugins/OSX/src/java/net/java/games/input/OSXHIDDevice.java
index 27102ca..40024c3 100644
--- a/plugins/OSX/src/java/net/java/games/input/OSXHIDDevice.java
+++ b/plugins/OSX/src/java/net/java/games/input/OSXHIDDevice.java
@@ -43,6 +43,7 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.Iterator;
+import java.util.logging.Logger;
/** OSX HIDManager implementation
* @author elias
@@ -50,6 +51,7 @@ import java.util.Iterator;
* @version 1.0
*/
final class OSXHIDDevice {
+ private final static Logger log = Logger.getLogger(OSXHIDDevice.class.getName());
private final static int AXIS_DEFAULT_MIN_VALUE = 0;
private final static int AXIS_DEFAULT_MAX_VALUE = 64*1024;
@@ -152,7 +154,7 @@ final class OSXHIDDevice {
int usage_page = getIntFromProperties(element_properties, kIOHIDElementUsagePageKey);
UsagePair usage_pair = createUsagePair(usage_page, usage);
if (usage_pair == null || (element_type != ElementType.INPUT_MISC && element_type != ElementType.INPUT_BUTTON && element_type != ElementType.INPUT_AXIS)) {
-//System.out.println("element_type = 0x" + element_type + " | usage = " + usage + " | usage_page = " + usage_page);
+ //log.info("element_type = 0x" + element_type + " | usage = " + usage + " | usage_page = " + usage_page);
return null;
} else {
return new OSXHIDElement(this, usage_pair, element_cookie, element_type, min, max, is_relative);
@@ -238,17 +240,17 @@ final class OSXHIDDevice {
}
*/
private final void dumpProperties() {
- System.out.println(toString());
+ log.info(toString());
dumpMap("", properties);
}
private final static void dumpArray(String prefix, Object[] array) {
- System.out.println(prefix + "{");
+ log.info(prefix + "{");
for (int i = 0; i < array.length; i++) {
dumpObject(prefix + "\t", array[i]);
- System.out.println(prefix + ",");
+ log.info(prefix + ",");
}
- System.out.println(prefix + "}");
+ log.info(prefix + "}");
}
private final static void dumpMap(String prefix, Map map) {
@@ -264,13 +266,13 @@ final class OSXHIDDevice {
private final static void dumpObject(String prefix, Object obj) {
if (obj instanceof Long) {
Long l = (Long)obj;
- System.out.println(prefix + "0x" + Long.toHexString(l.longValue()));
+ log.info(prefix + "0x" + Long.toHexString(l.longValue()));
} else if (obj instanceof Map)
dumpMap(prefix, (Map)obj);
else if (obj.getClass().isArray())
dumpArray(prefix, (Object[])obj);
else
- System.out.println(prefix + obj);
+ log.info(prefix + obj);
}
private final Map getDeviceProperties() throws IOException {
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java b/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java
index 509c108..31d36e7 100644
--- a/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java
+++ b/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java
@@ -25,6 +25,8 @@
*/
package net.java.games.input;
+import java.util.logging.Logger;
+
/**
* Mapping utility class between native type ints and string names or
* Key.Identifiers
@@ -32,6 +34,7 @@ package net.java.games.input;
*/
class LinuxNativeTypesMap {
private static LinuxNativeTypesMap INSTANCE = new LinuxNativeTypesMap();
+ private static Logger log = Logger.getLogger(LinuxNativeTypesMap.class.getName());
private final Component.Identifier relAxesIDs[];
private final Component.Identifier absAxesIDs[];
@@ -755,7 +758,7 @@ class LinuxNativeTypesMap {
try {
retval = INSTANCE.relAxesIDs[nativeID];
} catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("INSTANCE.relAxesIDis only " + INSTANCE.relAxesIDs.length + " long, so " + nativeID + " not contained");
+ log.warn("INSTANCE.relAxesIDis only " + INSTANCE.relAxesIDs.length + " long, so " + nativeID + " not contained");
//ignore, pretend it was null
}
if(retval == null) {
@@ -773,7 +776,7 @@ class LinuxNativeTypesMap {
try {
retval = INSTANCE.absAxesIDs[nativeID];
} catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("INSTANCE.absAxesIDs is only " + INSTANCE.absAxesIDs.length + " long, so " + nativeID + " not contained");
+ log.warn("INSTANCE.absAxesIDs is only " + INSTANCE.absAxesIDs.length + " long, so " + nativeID + " not contained");
//ignore, pretend it was null
}
if(retval == null) {
@@ -791,7 +794,7 @@ class LinuxNativeTypesMap {
try {
retval = INSTANCE.buttonIDs[nativeID];
} catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("INSTANCE.buttonIDs is only " + INSTANCE.buttonIDs.length + " long, so " + nativeID + " not contained");
+ log.warn("INSTANCE.buttonIDs is only " + INSTANCE.buttonIDs.length + " long, so " + nativeID + " not contained");
//ignore, pretend it was null
}
if(retval == null) {