Skip to content

Commit a5f6eda

Browse files
committed
minor updates on logger usage
1 parent f3b11f0 commit a5f6eda

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

src/main/java/act/xio/undertow/UndertowWebSocketConnectionHandler.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,11 @@
3838
import io.undertow.websockets.core.StreamSourceFrameChannel;
3939
import io.undertow.websockets.core.WebSocketChannel;
4040
import io.undertow.websockets.spi.WebSocketHttpExchange;
41-
import org.osgl.logging.LogManager;
42-
import org.osgl.logging.Logger;
4341

4442
import java.io.IOException;
4543

4644
class UndertowWebSocketConnectionHandler extends WebSocketConnectionHandler {
4745

48-
private static final Logger LOGGER = LogManager.get(UndertowWebSocketConnectionHandler.class);
49-
5046
UndertowWebSocketConnectionHandler (WebSocketConnectionManager manager) {
5147
super(manager);
5248
}
@@ -57,8 +53,8 @@ class UndertowWebSocketConnectionHandler extends WebSocketConnectionHandler {
5753

5854
@Override
5955
public void handle(final ActionContext context) {
60-
if (LOGGER.isTraceEnabled()) {
61-
LOGGER.trace("handle websocket connection request to %s", context.req().url());
56+
if (logger.isTraceEnabled()) {
57+
logger.trace("handle websocket connection request to %s", context.req().url());
6258
}
6359
final UndertowRequest req = (UndertowRequest) context.req();
6460
HttpServerExchange exchange = req.exchange();
@@ -70,24 +66,24 @@ public void onConnect(WebSocketHttpExchange exchange, WebSocketChannel channel)
7066
channel.setAttribute("act_conn", connection);
7167
connectionManager.registerNewConnection(connection, context);
7268
final WebSocketContext wsCtx = new WebSocketContext(req.url(), connection, connectionManager, context, connectionManager.app());
73-
if (LOGGER.isTraceEnabled()) {
74-
LOGGER.trace("websocket context[%s] created for %s", connection.sessionId(), context.req().url());
69+
if (logger.isTraceEnabled()) {
70+
logger.trace("websocket context[%s] created for %s", connection.sessionId(), context.req().url());
7571
}
7672
channel.getReceiveSetter().set(new AbstractReceiveListener() {
7773
@Override
7874
protected void onFullTextMessage(WebSocketChannel channel, BufferedTextMessage message) throws IOException {
7975
String payload = message.getData();
80-
if (LOGGER.isTraceEnabled()) {
81-
LOGGER.trace("websocket message received: %s", payload);
76+
if (logger.isTraceEnabled()) {
77+
logger.trace("websocket message received: %s", payload);
8278
}
8379
wsCtx.messageReceived(payload);
8480
invoke(wsCtx);
8581
}
8682

8783
@Override
8884
protected void onClose(WebSocketChannel webSocketChannel, StreamSourceFrameChannel channel) throws IOException {
89-
if (LOGGER.isTraceEnabled()) {
90-
LOGGER.trace("websocket closed: ", connection.sessionId());
85+
if (logger.isTraceEnabled()) {
86+
logger.trace("websocket closed: ", connection.sessionId());
9187
}
9288
super.onClose(webSocketChannel, channel);
9389
connection.destroy();

0 commit comments

Comments
 (0)