Skip to content

Commit

Permalink
Add global logger for Java internals (forward to Scala global logger)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvlugter committed Mar 12, 2014
1 parent 759c84f commit 8328200
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion framework/src/play-java/src/main/java/play/libs/Comet.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void onConnected() {
try { try {
callback.invoke(this); callback.invoke(this);
} catch (Throwable e) { } catch (Throwable e) {
play.Logger.of("play").error("Exception in Comet.onConnected", e); play.PlayInternal.logger().error("Exception in Comet.onConnected", e);
} }
} }
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void onConnected() {
try { try {
callback.invoke(this); callback.invoke(this);
} catch (Throwable e) { } catch (Throwable e) {
play.Logger.of("play").error("Exception in EventSource.onConnected", e); play.PlayInternal.logger().error("Exception in EventSource.onConnected", e);
} }
} }
} }
Expand Down
16 changes: 16 additions & 0 deletions framework/src/play/src/main/java/play/PlayInternal.java
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package play;

/**
* Play internal global API.
*/
public class PlayInternal {
/*
* Global logger for Play internals.
*/
public static org.slf4j.Logger logger() {
return play.api.Play$.MODULE$.logger().underlyingLogger();
}
}
2 changes: 1 addition & 1 deletion framework/src/play/src/main/java/play/mvc/Results.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ public void invoke() throws Throwable {
try { try {
callback.invoke(); callback.invoke();
} catch(Throwable e) { } catch(Throwable e) {
play.Logger.of("play").error("Exception is Chunks disconnected callback", e); play.PlayInternal.logger().error("Exception is Chunks disconnected callback", e);
} }
} }
} }
Expand Down
2 changes: 1 addition & 1 deletion framework/src/play/src/main/java/play/mvc/WebSocket.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void onReady(In<A> in, Out<A> out) {
try { try {
callback.invoke(in, out); callback.invoke(in, out);
} catch (Throwable e) { } catch (Throwable e) {
play.Logger.of("play").error("Exception in WebSocket.onReady", e); play.PlayInternal.logger().error("Exception in WebSocket.onReady", e);
} }
} }
} }
Expand Down

0 comments on commit 8328200

Please sign in to comment.