Browse code

fix logging in JavaGamepads

devnewton authored on 04/06/2014 02:26:15
Showing 1 changed files
... ...
@@ -8,6 +8,7 @@ import org.lwjgl.LWJGLException;
8 8
 import org.lwjgl.input.Controllers;
9 9
 import playn.core.Gamepad;
10 10
 import playn.core.Gamepads;
11
+import playn.core.Platform;
11 12
 
12 13
 /**
13 14
  *
... ...
@@ -16,6 +17,11 @@ import playn.core.Gamepads;
16 17
 class JavaGamepads implements Gamepads {
17 18
 
18 19
     private final List<Gamepad> gamepads = new ArrayList<Gamepad>();
20
+    private final Platform platform;
21
+    
22
+    public JavaGamepads(Platform platform) {
23
+        this.platform = platform;
24
+    }
19 25
 
20 26
     public void init() {
21 27
         gamepads.clear();
... ...
@@ -25,7 +31,7 @@ class JavaGamepads implements Gamepads {
25 31
                 gamepads.add(new JavaGamepad(Controllers.getController(i)));
26 32
             }
27 33
         } catch (LWJGLException e) {
28
-            Logger.getLogger(JavaGamepads.class.getName()).log(Level.WARNING, "Cannot init gamepads service", e);
34
+            platform.log().error("Cannot init gamepads service", e);
29 35
         }
30 36
 
31 37
     }