Skip to content

Commit d3e4b1b

Browse files
committed
Consistently use constant log messages
1 parent 8cc2b0f commit d3e4b1b

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

epoll/src/main/java/tel/schich/javacan/util/CanBroker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ protected void processEvents(List<IOEvent<UnixFileDescriptor>> events) throws IO
274274
readBuffer.clear();
275275
handler.handle(raw, raw.read(readBuffer));
276276
} else {
277-
LOGGER.warn("Handler not found for channel: " + ch);
277+
LOGGER.warn("Handler not found for channel: {}", ch);
278278
}
279279
} else {
280-
LOGGER.warn("Unsupported channel: " + ch);
280+
LOGGER.warn("Unsupported channel: {}", ch);
281281
}
282282
}
283283
}

epoll/src/main/java/tel/schich/javacan/util/EventLoop.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ protected final boolean poll(Duration timeout) throws IOException {
222222
* @return true if the event loop should continue, false for the event loop to exit
223223
*/
224224
protected boolean handleException(Thread thread, Throwable t, boolean terminal) {
225-
LOGGER.error("Polling thread failed: " + thread.getName(), t);
225+
LOGGER.error("Polling thread failed: {}", thread.getName(), t);
226226
LOGGER.warn("Terminating other threads.");
227227

228228
try {

epoll/src/main/java/tel/schich/javacan/util/IsotpListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ protected void processEvents(List<IOEvent<UnixFileDescriptor>> events) throws IO
137137
readBuffer.flip();
138138
handler.handle(isotp, readBuffer.asReadOnlyBuffer());
139139
} else {
140-
LOGGER.warn("Handler not found for channel: " + ch);
140+
LOGGER.warn("Handler not found for channel: {}", ch);
141141
}
142142
} else {
143-
LOGGER.warn("Unsupported channel: " + ch);
143+
LOGGER.warn("Unsupported channel: {}", ch);
144144
}
145145
}
146146
}

epoll/src/test/java/tel/schich/javacan/test/select/EPollSelectorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ public void testEPollFdReuse() throws IOException, InterruptedException {
129129

130130
private static SelectorRegistration<UnixFileDescriptor, RawCanChannel> configureAndRegisterChannel(IOSelector<UnixFileDescriptor> selector) throws IOException {
131131
final RawCanChannel ch = CanChannels.newRawChannel(CAN_INTERFACE);
132-
LOGGER.debug("Created channel: " + ch);
132+
LOGGER.debug("Created channel: {}", ch);
133133

134134
ch.configureBlocking(false);
135135
ch.setOption(CanSocketOptions.LOOPBACK, true);
136136
SelectorRegistration<UnixFileDescriptor, RawCanChannel> registration = selector.register(ch, SelectorRegistration.Operation.READ);
137-
LOGGER.debug("Selection key: " + registration);
137+
LOGGER.debug("Selection key: {}", registration);
138138

139139
return registration;
140140
}

0 commit comments

Comments
 (0)