Skip to content

Commit 494f46b

Browse files
committed
Fix minor issues with logging levels
1 parent 14429fa commit 494f46b

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

cdtp-examples/src/main/java/com/github/kklisura/cdpt/examples/LogRequestsExample.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@ public static void main(String[] args) throws InterruptedException {
5454

5555
// Navigate to github.com.
5656
page.navigate("http://github.com");
57+
58+
devToolsService.waitUntilClosed();
5759
}
5860
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
4+
<!-- Send debug messages to System.out -->
5+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
6+
<encoder>
7+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
8+
</encoder>
9+
</appender>
10+
11+
<!-- By default, the level of the root level is set to DEBUG -->
12+
<root level="INFO">
13+
<appender-ref ref="STDOUT" />
14+
</root>
15+
</configuration>

cdtp-java-client/src/main/java/com/github/kklisura/cdtp/services/impl/WebSocketServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ public static WebSocketService create(URI uri) throws WebSocketServiceException
7979

8080
@Override
8181
public void connect(URI uri) throws WebSocketServiceException {
82-
LOGGER.info("Connecting to ws server {}", uri);
82+
LOGGER.debug("Connecting to ws server {}", uri);
8383

8484
try {
8585
session =
8686
WEB_SOCKET_CONTAINER.connectToServer(
8787
new Endpoint() {
8888
@Override
8989
public void onOpen(Session session, EndpointConfig config) {
90-
LOGGER.debug("Connected to ws server {}", uri);
90+
LOGGER.info("Connected to ws server {}", uri);
9191
}
9292

9393
// TODO(kklisura): Add close handler.
@@ -102,7 +102,7 @@ public void onOpen(Session session, EndpointConfig config) {
102102
@Override
103103
public void send(String message) throws WebSocketServiceException {
104104
try {
105-
LOGGER.info("Sending message {} on {}", message, session.getRequestURI());
105+
LOGGER.debug("Sending message {} on {}", message, session.getRequestURI());
106106
session.getBasicRemote().sendText(message);
107107
} catch (Exception e) {
108108
LOGGER.error("Failed sending data to ws server {}...", session.getRequestURI(), e);

0 commit comments

Comments
 (0)