Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #4733] Substitute e.printStackTrace() with log.error() #4754

Merged
merged 3 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ThreadWrapperTest {

@Test
Expand Down Expand Up @@ -74,7 +77,7 @@ public void run() {
try {
TimeUnit.MILLISECONDS.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
log.error("[ThreadWrapperTest][shutdown] InterruptedException", e);
}
counter.set(100);
}
Expand Down Expand Up @@ -136,4 +139,4 @@ public void run() {
wrapper.setDaemon(daemon);
return wrapper;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ public void stop() {
try {
source.stop();
} catch (Exception e) {
e.printStackTrace();
log.error("source destroy error", e);
}
log.info("pollService stopping");
Expand Down Expand Up @@ -330,15 +329,15 @@ public boolean commitOffsets() {
log.info("{} Committing offsets for {} acknowledged messages", this, committableOffsets.numCommittableMessages());
if (committableOffsets.hasPending()) {
log.debug("{} There are currently {} pending messages spread across {} source partitions whose offsets will not be committed. "
+ "The source partition with the most pending messages is {}, with {} pending messages",
+ "The source partition with the most pending messages is {}, with {} pending messages",
this,
committableOffsets.numUncommittableMessages(),
committableOffsets.numDeques(),
committableOffsets.largestDequePartition(),
committableOffsets.largestDequeSize());
} else {
log.debug("{} There are currently no pending messages for this offset commit; "
+ "all messages dispatched to the task's producer since the last commit have been acknowledged",
+ "all messages dispatched to the task's producer since the last commit have been acknowledged",
this);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void close() {
task.cancel(false);
super.close();
} catch (Exception e) {
e.printStackTrace();
log.error("PubClientImpl|{}|close failed!", clientNo, e);
}
}

Expand Down
Loading