Skip to content

io microsphere logging test jupiter extension logging LoggingLevelTemplateInvocationContext

github-actions[bot] edited this page May 30, 2026 · 9 revisions

LoggingLevelTemplateInvocationContext

Type: Class | Module: microsphere-logging-test | Package: io.microsphere.logging.test.jupiter.extension.logging | Since: 1.0.0

Source: microsphere-logging-test/src/main/java/io/microsphere/logging/test/jupiter/extension/logging/LoggingLevelTemplateInvocationContext.java

Overview

The facade class of ClassTemplateInvocationContext and TestTemplateInvocationContext to set the logging level.

Declaration

class LoggingLevelTemplateInvocationContext implements ClassTemplateInvocationContext, TestTemplateInvocationContext

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.1.14-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 8 ✅ Compatible
Java 11 ✅ Compatible
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

Method Examples

getDisplayName

List<Logging> loggings = LoggingUtils.loadAll();
  LoggingLevelTemplateInvocationContext ctx =
      new LoggingLevelTemplateInvocationContext(loggings, new String[]{"io.microsphere"}, "DEBUG", 0, false);
LoggingLevelTemplateInvocationContext ctx = ...;
  String displayName = ctx.getDisplayName(1); // e.g. "[DEBUG]"

getAdditionalExtensions

LoggingLevelTemplateInvocationContext ctx = ...;
  List<Extension> extensions = ctx.getAdditionalExtensions();

prepareInvocation

LoggingLevelTemplateInvocationContext ctx = ...;
  ctx.prepareInvocation(extensionContext);

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-logging-test</artifactId>
    <version>${microsphere-logging.version}</version>
</dependency>

Tip: Use the BOM (microsphere-logging-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.logging.test.jupiter.extension.logging.LoggingLevelTemplateInvocationContext;

API Reference

Public Methods

Method Description
getDisplayName Creates a new LoggingLevelTemplateInvocationContext.
getAdditionalExtensions {@inheritDoc}
prepareInvocation Prepares the invocation context before each test execution.

Method Details

getDisplayName

public String getDisplayName(int invocationIndex)

Creates a new LoggingLevelTemplateInvocationContext.

Example Usage

`List loggings = LoggingUtils.loadAll();
  LoggingLevelTemplateInvocationContext ctx =
      new LoggingLevelTemplateInvocationContext(loggings, new String[]{"io.microsphere"`, "DEBUG", 0, false);
}

getAdditionalExtensions

public List<Extension> getAdditionalExtensions()

{@inheritDoc}

Example Usage

`LoggingLevelTemplateInvocationContext ctx = ...;
  List extensions = ctx.getAdditionalExtensions();
`

prepareInvocation

public void prepareInvocation(ExtensionContext context)

Prepares the invocation context before each test execution.

Example Usage

`LoggingLevelTemplateInvocationContext ctx = ...;
  ctx.prepareInvocation(extensionContext);
`

See Also

  • ClassTemplateInvocationContext
  • TestTemplateInvocationContext

This documentation was auto-generated from the source code of microsphere-logging.

Clone this wiki locally