aboutsummaryrefslogtreecommitdiffstats
path: root/coreAPI
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 /coreAPI
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 'coreAPI')
-rw-r--r--coreAPI/src/java/net/java/games/input/ControllerEnvironment.java3
-rw-r--r--coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java13
2 files changed, 10 insertions, 6 deletions
diff --git a/coreAPI/src/java/net/java/games/input/ControllerEnvironment.java b/coreAPI/src/java/net/java/games/input/ControllerEnvironment.java
index db6f1dc..17208f7 100644
--- a/coreAPI/src/java/net/java/games/input/ControllerEnvironment.java
+++ b/coreAPI/src/java/net/java/games/input/ControllerEnvironment.java
@@ -43,6 +43,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.logging.Logger;
/**
* A ControllerEnvironment represents a collection of controllers that are
@@ -74,7 +75,7 @@ public abstract class ControllerEnvironment {
}
static void log(String msg) {
- System.out.print(msg);
+ Logger.getLogger(ControllerEnvironment.class.getName()).info(msg);
}
/**
diff --git a/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java b/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java
index 93db7c7..833fe6f 100644
--- a/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java
+++ b/coreAPI/src/java/net/java/games/input/DefaultControllerEnvironment.java
@@ -49,6 +49,8 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.Properties;
import java.util.StringTokenizer;
+import java.util.logging.Logger;
+
import net.java.games.util.plugins.*;
/**
@@ -60,6 +62,8 @@ import net.java.games.util.plugins.*;
class DefaultControllerEnvironment extends ControllerEnvironment {
static String libPath;
+ private static Logger log = Logger.getLogger(DefaultControllerEnvironment.class.getName());
+
/**
* Static utility method for loading native libraries.
* It will try to load from either the path given by
@@ -138,12 +142,11 @@ class DefaultControllerEnvironment extends ControllerEnvironment {
} else if(osName.equals("Windows 98") || osName.equals("Windows 2000")) {
pluginClasses = pluginClasses + " net.java.games.input.DirectInputEnvironmentPlugin";
} else if (osName.startsWith("Windows")) {
- System.out.println("WARNING: Found unknown Windows version: " + osName);
- System.out.println("Attempting to use default windows plug-in.");
- System.out.flush();
+ log.warning("Found unknown Windows version: " + osName);
+ log.info("Attempting to use default windows plug-in.");
pluginClasses = pluginClasses + " net.java.games.input.DirectAndRawInputEnvironmentPlugin";
} else {
- System.out.println("Trying to use default plugin, OS name " + osName +" not recognised");
+ log.info("Trying to use default plugin, OS name " + osName +" not recognised");
}
}
@@ -152,7 +155,7 @@ class DefaultControllerEnvironment extends ControllerEnvironment {
String className = pluginClassTok.nextToken();
try {
if(!loadedPlugins.contains(className)) {
- System.out.println("Loading: " + className);
+ log.info("Loading: " + className);
Class ceClass = Class.forName(className);
ControllerEnvironment ce = (ControllerEnvironment) ceClass.newInstance();
if(ce.isSupported()) {