merlimat opened a new pull request, #4765:
URL: https://github.com/apache/bookkeeper/pull/4765
## Summary
Final pass to retire SLF4J from production-style code paths. After this, the
only remaining `LoggerFactory.getLogger()` in non-test code is the intentional
Codahale `Slf4jReporter` integration in `CodahaleMetricsProvider`, which
forwards stats to a named SLF4J logger and must stay on the SLF4J API.
## Conversion patterns (same as earlier BP-69 phases)
- `LoggerFactory.getLogger(Foo.class)` / `@Slf4j` → Lombok `@CustomLog` (the
top-level `lombok.config` already maps it to a slog `Logger`).
- `LOG.info("text {} {}", a, b)` → `log.info().attr("nameA",
a).attr("nameB", b).log("text")` — values become typed structured attributes
with meaningful names.
- `LOG.error("msg", exception)` →
`log.error().exception(exception).log("msg")`; `.exceptionMessage(e)` where
appropriate.
- `if (LOG.isDebugEnabled()) LOG.debug("...{}", expr)` →
`log.debug().attr("name", () -> expr).log("...")` — using the **lazy-supplier**
overload so eager evaluation is avoided when the level is disabled.
No log output format changes — slog with the SLF4J/log4j2 backend produces
equivalent output.
## Scope
48 files across:
| Module | Files |
|---|---|
| `bookkeeper-common-allocator` | 2 |
| `bookkeeper-common` | 8 |
| `bookkeeper-server` | 23 |
| `circe-checksum` | 1 |
| `cpu-affinity` | 2 |
| `tests/integration-tests-utils` | 5 |
| `tests/integration-tests-topologies` | 5 |
## IOUtils SLF4J overload removal
`IOUtils.close()` had four overloads — two slog and two SLF4J ("kept for
transition during the slog migration" per the doc comment). The transition is
now complete; no remaining callers in non-test code use the SLF4J overloads.
They are removed in this PR.
## Test plan
- [x] `mvn compile checkstyle:check` clean across the 7 touched modules
- [x] Local sample test runs (62 tests across `Test*Configuration*`,
`*DataIntegrity*`, `FutureUtilsTest`) pass
- [ ] Full CI matrix green
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]