Skip to content

Commit

Permalink
fix(java): fix fury logger npe (#1762)
Browse files Browse the repository at this point in the history
## What does this PR do?


## Related issues
Closes #1761 


## Does this PR introduce any user-facing change?

<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fury/issues/new/choose) describing the
need to do so and update the document if necessary.
-->

- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?


## Benchmark

<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
-->
  • Loading branch information
chaokunyang authored Jul 26, 2024
1 parent 6e4d8a0 commit 4f24bd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ private void log(int level, String msg, Object[] args, boolean mayPrintTrace) {
builder.append(":").append(lineNumber);
builder.append(" [").append(Thread.currentThread().getName()).append(']');
builder.append(" - ");
if (msg == null) {
msg = "null";
}
int len = msg.length();
int count = 0;
for (int i = 0; i < len; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ public void testInfo() {
furyLogger.info("testInfo {}", "placeHolder");
furyLogger.warn("testInfo {}", "placeHolder");
furyLogger.error("testInfo {}", "placeHolder", new Exception("test log"));
furyLogger.error(null, new Exception("test log"));
}
}

0 comments on commit 4f24bd4

Please sign in to comment.