fix: silence SLF4J NOP-logger warning from JGit in serve command#403
Open
tinder-maxwellelliott wants to merge 1 commit into
Open
fix: silence SLF4J NOP-logger warning from JGit in serve command#403tinder-maxwellelliott wants to merge 1 commit into
tinder-maxwellelliott wants to merge 1 commit into
Conversation
JGit (bazel-diff serve's in-process git engine) depends on slf4j-api but ships no binding, so SLF4J printed a "Failed to load class StaticLoggerBinder / Defaulting to no-operation (NOP) logger" warning to stderr on first use. Adds slf4j-nop as a runtime dep to supply the binding, silencing the warning while discarding JGit's internal logs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
bazel-diff serveuses JGit for in-process git operations; JGit depends onslf4j-apibut ships no binding, so SLF4J printedFailed to load class "org.slf4j.impl.StaticLoggerBinder" / Defaulting to no-operation (NOP) logger implementationto stderr on first use.org.slf4j:slf4j-nop:1.7.30(matching theslf4j-apiversion JGit resolves) as a runtime dep ofcli-lib, supplying the missing binding. This silences the warning and discards JGit's internal logs; bazel-diff's own logging (StderrLogger) is unaffected since it doesn't go through SLF4J.maven_install.jsonfor the new artifact.Test plan
Slf4jBindingTest(cli/src/test/kotlin/com/bazel_diff/log/Slf4jBindingTest.kt) assertingorg.slf4j.impl.StaticLoggerBinderresolves and that obtaining/using a logger writes nothing to stderr.slf4j-nopruntime dep and confirmed the test fails, reproducing the exact reported warning text; restored and confirmed it passes.bazel test //cli/...passes (E2ETestfails identically with/without this change — pre-existing sandbox flakiness with nested Bazel invocations, unrelated to this fix).bazel build //cli:bazel-diffsucceeds.🤖 Generated with Claude Code