Skip to content

Use java.util.logging instead of System.out/err - #127

Merged
uw4 merged 1 commit into
mainfrom
jdk-logging
Nov 4, 2026
Merged

uw4 merged 1 commit into
mainfrom
jdk-logging

Conversation

@aeberhart

Copy link
Copy Markdown
Contributor

Alternative to #118 that uses the standard JDK logger (java.util.logging) instead of slf4j, so the library stays dependency-free.

Changes

  • Parser: the dbg flag is replaced by a static JUL Logger. if (dbg) System.out.println(...) becomes if (log.isLoggable(Level.FINE)) log.fine(...), so tracing can be enabled via logging configuration and costs nothing when disabled.
  • Jsonata: same for the parser.dbg checks. The unconditional System.out/System.err messages are now log.warning("Proc not found ...") and log.severe("Function not implemented ...").
  • module-info.java: requires java.logging.
  • Commented-out code is left unchanged.
  • New LoggingTest: no records at the default level, and FINE trace records from Parser and Jsonata when enabled.
  • README: new "Logging" section that explains how to enable tracing and how to bridge to slf4j/log4j.

Testing

mvn test: 1731 tests, 0 failures.

🤖 Generated with Claude Code

Replace the dbg flag and the remaining System.out/err calls in Jsonata
and Parser with the standard JDK logger. Debug tracing is logged at FINE
and guarded by isLoggable, so it costs nothing when disabled. No new
dependency is added. Alternative to #118.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aeberhart
aeberhart requested a review from uw4 November 4, 2026 10:04
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Test Results

1 801 tests  +2   1 798 ✅ +2   8s ⏱️ +2s
  121 suites +1       3 💤 ±0 
  121 files   +1       0 ❌ ±0 

Results for commit 7302b72. ± Comparison against base commit 6b2f23a.

@aeberhart aeberhart mentioned this pull request Nov 4, 2026
@uw4
uw4 merged commit 6850f8d into main Nov 4, 2026
2 checks passed
@aeberhart aeberhart mentioned this pull request Nov 4, 2026
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.

2 participants