Skip to content

Add java.util.logging core APIs - #198

Merged
dlunch merged 2 commits into
mainfrom
agent/java-util-logging
Aug 9, 2026
Merged

Add java.util.logging core APIs#198
dlunch merged 2 commits into
mainfrom
agent/java-util-logging

Conversation

@dlunch

@dlunch dlunch commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • add the CLDC 8 logging core with common Java 1.4 Logger APIs
  • support logger hierarchy, levels, filters, handlers, stream formatting, and reset behavior
  • register the package and cover API behavior with java_runtime tests

Verification

  • cargo test -p java_runtime --no-fail-fast -q
  • cargo fmt --all -- --check
  • cargo clippy -p java_runtime --all-targets -- -D warnings

Copilot AI lite review requested due to automatic review settings August 9, 2026 10:46
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.88712% with 780 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.61%. Comparing base (5fbb27b) to head (5359f5e).

Files with missing lines Patch % Lines
...va_runtime/src/classes/java/util/logging/logger.rs 48.90% 561 Missing ⚠️
...me/src/classes/java/util/logging/stream_handler.rs 73.07% 77 Missing ⚠️
...untime/src/classes/java/util/logging/log_record.rs 81.38% 43 Missing ⚠️
...ava_runtime/src/classes/java/util/logging/level.rs 86.72% 32 Missing ⚠️
...a_runtime/src/classes/java/util/logging/handler.rs 80.43% 27 Missing ⚠️
...e/src/classes/java/util/logging/console_handler.rs 70.45% 13 Missing ⚠️
...ntime/src/classes/java/util/logging/log_manager.rs 94.82% 13 Missing ⚠️
...runtime/src/classes/java/util/logging/formatter.rs 93.96% 7 Missing ⚠️
.../src/classes/java/util/logging/simple_formatter.rs 91.02% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #198      +/-   ##
==========================================
- Coverage   87.74%   86.61%   -1.14%     
==========================================
  Files         298      308      +10     
  Lines       39025    41532    +2507     
==========================================
+ Hits        34244    35972    +1728     
- Misses       4781     5560     +779     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a Rust-backed implementation of core java.util.logging APIs to the java_runtime crate (CLDC 8 / Java 1.4-style surface), wires the new runtime classes into the class loader, and introduces JVM-level tests validating key behaviors like hierarchy, filtering, formatting, and reset semantics.

Changes:

  • Implement java.util.logging runtime classes (Logger, LogManager, Level, LogRecord, Handler/StreamHandler/ConsoleHandler, Formatter/SimpleFormatter, Filter).
  • Register the new logging classes in java_runtime’s runtime class loader and expose the module under java::util.
  • Add java_runtime tests covering registration and major API behaviors (levels, records, handlers, logger propagation, reset).

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
java_runtime/src/classes/java/util.rs Exposes the new util::logging module from the Java runtime.
java_runtime/src/classes/java/util/logging.rs Declares and re-exports the java.util.logging runtime types.
java_runtime/src/classes/java/util/logging/console_handler.rs Implements ConsoleHandler backed by System.err via StreamHandler.
java_runtime/src/classes/java/util/logging/filter.rs Adds the Filter interface definition.
java_runtime/src/classes/java/util/logging/formatter.rs Adds base Formatter including formatMessage parameter substitution support.
java_runtime/src/classes/java/util/logging/handler.rs Implements Handler base behavior (level/filter/encoding/formatter management).
java_runtime/src/classes/java/util/logging/level.rs Implements Level constants and parsing behavior.
java_runtime/src/classes/java/util/logging/log_manager.rs Implements LogManager singleton, logger registry, hierarchy re-parenting, and reset.
java_runtime/src/classes/java/util/logging/log_record.rs Implements LogRecord storage, metadata initialization, and sequence allocation.
java_runtime/src/classes/java/util/logging/logger.rs Implements Logger creation, hierarchy, handlers, filtering, and convenience logging methods.
java_runtime/src/classes/java/util/logging/simple_formatter.rs Implements SimpleFormatter formatting for LogRecord.
java_runtime/src/classes/java/util/logging/stream_handler.rs Implements StreamHandler writing formatted records to an OutputStream.
java_runtime/src/loader.rs Registers java/util/logging/* runtime class protos so they can be loaded.
java_runtime/tests/classes/java/util/mod.rs Hooks java.util.logging test module into the java.util test suite.
java_runtime/tests/classes/java/util/logging/mod.rs Adds the logging test module root.
java_runtime/tests/classes/java/util/logging/test_handlers.rs Tests StreamHandler filtering/leveling and Formatter.formatMessage parameter substitution.
java_runtime/tests/classes/java/util/logging/test_level.rs Tests class registration metadata and Level constants/parse behavior.
java_runtime/tests/classes/java/util/logging/test_log_record.rs Tests LogRecord metadata initialization, sequencing, and null-level rejection.
java_runtime/tests/classes/java/util/logging/test_logger.rs Tests logger reuse, hierarchy re-parenting, propagation control, and LogManager reset behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread java_runtime/src/classes/java/util/logging/level.rs
Comment thread java_runtime/src/classes/java/util/logging/logger.rs
Comment thread java_runtime/src/classes/java/util/logging/log_manager.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5b06037ca9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread java_runtime/src/classes/java/util/logging/stream_handler.rs Outdated
Comment thread java_runtime/src/classes/java/util/logging/logger.rs
Comment thread java_runtime/src/classes/java/util/logging/formatter.rs Outdated
Comment thread java_runtime/src/classes/java/util/logging/simple_formatter.rs Outdated
Comment thread java_runtime/src/classes/java/util/logging/log_record.rs
@dlunch
dlunch merged commit a1e6fdf into main Aug 9, 2026
13 of 15 checks passed
@dlunch
dlunch deleted the agent/java-util-logging branch August 9, 2026 11:02
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