Skip to content

fix: silence SLF4J NOP-logger warning from JGit in serve command#403

Merged
tinder-maxwellelliott merged 1 commit into
masterfrom
claude/upbeat-ptolemy-d8ea6e
Jul 2, 2026
Merged

fix: silence SLF4J NOP-logger warning from JGit in serve command#403
tinder-maxwellelliott merged 1 commit into
masterfrom
claude/upbeat-ptolemy-d8ea6e

Conversation

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

Summary

  • bazel-diff serve uses JGit for in-process git operations; JGit depends on slf4j-api but ships no binding, so SLF4J printed Failed to load class "org.slf4j.impl.StaticLoggerBinder" / Defaulting to no-operation (NOP) logger implementation to stderr on first use.
  • Adds org.slf4j:slf4j-nop:1.7.30 (matching the slf4j-api version JGit resolves) as a runtime dep of cli-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.
  • Re-pinned maven_install.json for the new artifact.

Test plan

  • Added Slf4jBindingTest (cli/src/test/kotlin/com/bazel_diff/log/Slf4jBindingTest.kt) asserting org.slf4j.impl.StaticLoggerBinder resolves and that obtaining/using a logger writes nothing to stderr.
  • Verified the test is a real regression guard: temporarily removed the slf4j-nop runtime dep and confirmed the test fails, reproducing the exact reported warning text; restored and confirmed it passes.
  • bazel test //cli/... passes (E2ETest fails identically with/without this change — pre-existing sandbox flakiness with nested Bazel invocations, unrelated to this fix).
  • bazel build //cli:bazel-diff succeeds.

🤖 Generated with Claude Code

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>
@tinder-maxwellelliott tinder-maxwellelliott merged commit a6a6564 into master Jul 2, 2026
15 checks passed
@tinder-maxwellelliott tinder-maxwellelliott deleted the claude/upbeat-ptolemy-d8ea6e branch July 2, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant