From 5eb89d4e124d113f7c46396b244408cc5d997f84 Mon Sep 17 00:00:00 2001 From: Endolf Date: Thu, 24 May 2018 22:41:39 +0100 Subject: [PATCH] Disable logging option --- .../java/net/java/games/input/ControllerEnvironment.java | 6 ++++++ examples/pom.xml | 1 + 2 files changed, 7 insertions(+) diff --git a/coreAPI/src/main/java/net/java/games/input/ControllerEnvironment.java b/coreAPI/src/main/java/net/java/games/input/ControllerEnvironment.java index 510436e..795c9f1 100644 --- a/coreAPI/src/main/java/net/java/games/input/ControllerEnvironment.java +++ b/coreAPI/src/main/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.Level; import java.util.logging.Logger; /** @@ -90,6 +91,11 @@ public abstract class ControllerEnvironment { * Protected constructor for subclassing. */ protected ControllerEnvironment() { + if(System.getProperty("jinput.loglevel") != null) { + String loggerName = ControllerEnvironment.class.getPackage().getName(); + Level level = Level.parse(System.getProperty("jinput.loglevel")); + Logger.getLogger(loggerName).setLevel(level); + } } /** diff --git a/examples/pom.xml b/examples/pom.xml index 3ce0cef..0589f16 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -109,6 +109,7 @@ -classpath -Djava.library.path=${project.build.directory}/natives + -Djinput.loglevel=OFF net.java.games.input.example.ReadAllEvents