Skip to content

docs: add JavaDoc with example usage to all undocumented classes and non-private methods#30

Merged
mercyblitz merged 1 commit into
mainfrom
copilot/add-javadoc-to-classes-methods
May 21, 2026
Merged

docs: add JavaDoc with example usage to all undocumented classes and non-private methods#30
mercyblitz merged 1 commit into
mainfrom
copilot/add-javadoc-to-classes-methods

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

Several classes and non-private methods across the codebase lacked JavaDoc entirely. All added JavaDoc includes an <h3>Example Usage</h3> block with inline code examples.

Changes by module

  • microsphere-logging-commonsLoggingMXBeanAdapter: constructor + all overridden methods
  • microsphere-log4j2Log4j2Logger, Log4j2LoggerFactory, Log4j2Logging, Log4j2Utils (utility methods missing docs), InMemoryAppender (all lifecycle/accessor methods + findInMemoryAppender), LogEventComparator#compare, SmartFileAppenderLayout (constructor + interface methods), DelegatingLayout (constructors + getDelegate/setDelegate)
  • microsphere-log4jLog4jLogger, Log4jLoggerFactory, Log4jLogging
  • microsphere-logbackLogbackLogging
  • microsphere-java-loggingJavaLogging
  • microsphere-logging-testLoggingLevelsRule, LoggingLevelsStatement, LoggingLevelsExtension (constructor + all non-private methods), LoggingLevelTemplateInvocationContext, LoggingLevelParameterResolver, LoggingLevelCallback

Example format applied consistently

/**
 * Sets the logging level for each logger name before each test method executes,
 * storing the original levels for later restoration.
 *
 * @param context the current {@link ExtensionContext}
 *
 * <h3>Example Usage</h3>
 * <pre>{@code
 *   // Called automatically by JUnit 5 before each test method in a @LoggingLevelsTest template
 *   callback.beforeEach(extensionContext);
 * }</pre>
 */
@Override
public void beforeEach(ExtensionContext context) { ... }

No logic was changed — purely documentation additions.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ Complexity Δ
...n/java/io/microsphere/logging/jdk/JavaLogging.java 100.00% <ø> (ø) 10.00 <0.00> (ø)
...java/io/microsphere/logging/log4j/Log4jLogger.java 100.00% <ø> (ø) 17.00 <0.00> (ø)
.../microsphere/logging/log4j/Log4jLoggerFactory.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
...ava/io/microsphere/logging/log4j/Log4jLogging.java 100.00% <ø> (ø) 9.00 <0.00> (ø)
...va/io/microsphere/logging/log4j2/Log4j2Logger.java 100.00% <ø> (ø) 17.00 <0.00> (ø)
...icrosphere/logging/log4j2/Log4j2LoggerFactory.java 100.00% <ø> (ø) 4.00 <0.00> (ø)
...a/io/microsphere/logging/log4j2/Log4j2Logging.java 100.00% <ø> (ø) 9.00 <0.00> (ø)
...microsphere/logging/log4j2/LogEventComparator.java 100.00% <ø> (ø) 3.00 <0.00> (ø)
...here/logging/log4j2/appender/InMemoryAppender.java 100.00% <ø> (ø) 13.00 <0.00> (ø)
...sphere/logging/log4j2/layout/DelegatingLayout.java 100.00% <ø> (ø) 11.00 <0.00> (ø)
... and 10 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 21, 2026

🤖 Augment PR Summary

Summary: This PR adds missing JavaDoc across the microsphere-logging modules, standardizing documentation to include an <h3>Example Usage</h3> section for previously undocumented classes and non-private methods.

Changes:

  • Documented core logging implementations (JDK, Log4j 1, Log4j2, Logback) with method-level JavaDoc and usage snippets.
  • Added JavaDoc to factory/wrapper types (e.g., logger factories, delegating wrappers) to clarify delegation and priorities.
  • Expanded documentation for Log4j2 utilities/appender/layout helpers (e.g., in-memory appender, delegating layouts, smart file layout).
  • Improved test-module documentation for JUnit 4 rules and JUnit 5 extensions/template invocation contexts around iterating logging levels and restoring state.

Technical Notes: Intended to be documentation-only with no behavioral changes; examples are embedded as inline code blocks under each documented API.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

* <h3>Example Usage</h3>
* <pre>{@code
* Log4j2Logger logger = new Log4j2Logger("io.microsphere");
* logger.debug("processing item: {}", item);
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 21, 2026

Choose a reason for hiding this comment

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

microsphere-log4j2/src/main/java/io/microsphere/logging/log4j2/Log4j2Logger.java:119 — This example calls logger.debug("processing item: {}", item), but Log4j2Logger#debug(String) only accepts a single String and this snippet won’t compile (and implies unsupported parameter substitution). Consider aligning the example with the wrapper API to avoid misleading users.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

* Logging logging = LoggingUtils.load();
* LoggingMXBeanAdapter adapter1 = new LoggingMXBeanAdapter(logging);
* LoggingMXBeanAdapter adapter2 = new LoggingMXBeanAdapter(logging);
* boolean equal = adapter1.equals(adapter2);
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 21, 2026

Choose a reason for hiding this comment

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

microsphere-logging-commons/src/main/java/io/microsphere/logging/jmx/LoggingMXBeanAdapter.java:152 — The equals example suggests adapter1.equals(adapter2) might be meaningful, but equals() delegates to logging.equals(obj), so comparing to another adapter will likely return false. This could mislead users about the adapter’s equality semantics.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

*/
public void prepareInvocation(ExtensionContext context) {
}
} No newline at end of file
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 21, 2026

Choose a reason for hiding this comment

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

microsphere-logging-test/src/main/java/io/microsphere/logging/test/jupiter/extension/logging/LoggingLevelTemplateInvocationContext.java:120 — The diff indicates the file has no trailing newline (\ No newline at end of file), which can cause noisy diffs and tooling edge cases. Consider restoring the final newline.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@mercyblitz mercyblitz merged commit f2a43c1 into main May 21, 2026
1 of 6 checks passed
@mercyblitz mercyblitz deleted the copilot/add-javadoc-to-classes-methods branch May 21, 2026 10:59
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