Enhance DualLogger to fan out throwables to log hooks - #249
Merged
Merged
Conversation
DualLogger only exposed info(), and its message fan-out to log hooks dropped any Throwable argument. Deploy/delete failure paths logged at info without the exception, so hook consumers (e.g. the CLI/UI deploy log) never saw the cause. - Extract a shared fanOut() helper and add trace/debug/warn/error alongside info, all Throwable-aware. When the trailing argument is a Throwable, slf4j logs the stack trace and the throwable detail is appended to the hook text (falling back to toString() when the message is null). - Log the exception at the DDL deploy/delete failure sites in HoptimatorDdlExecutor and HoptimatorDdlUtils, switching them from info to warn and passing the caught exception. - Add exhaustive DualLoggerTest coverage across all levels and the full argument-count x throwable matrix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Code Coverage
|
ryannedolan
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
DualLoggerfans each message out to both an SLF4J logger and a list of log hooks (surfaced to hook consumers such as the CLI/UI deploy log). It only exposedinfo(), and its hook fan-out dropped anyThrowableargument. As a result, the DDL deploy/delete failure paths logged atinfowithout the exception, so hook consumers never saw the cause of a failure.Changes
DualLogger: extracted a sharedfanOut()helper and addedtrace/debug/warn/erroralongsideinfo, allThrowable-aware. When the trailing argument is aThrowable, SLF4J logs it with a stack trace and the throwable detail is appended to the hook text (falling back totoString()when the throwable message isnull).HoptimatorDdlExecutor/HoptimatorDdlUtils: the 8 deploy/delete failurecatchblocks now log atwarnand pass the caught exception, so the cause reaches the hooks.DualLoggerTest: exhaustive coverage — parameterized across all five levels, plus the full argument-count x throwable matrix (too many / not enough / exact args, with and without a trailing throwable, and corner cases such as a throwable as the sole argument with/without a placeholder, null-message fallback, and a non-trailing throwable treated as a normal parameter).Testing
./gradlew :hoptimator-jdbc:test— all pass (41DualLoggerTestcases, 0 failures).