Add java.util.logging core APIs - #198
Conversation
There was a problem hiding this comment.
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.loggingruntime 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 underjava::util. - Add
java_runtimetests 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Verification