-
Notifications
You must be signed in to change notification settings - Fork 1
io microsphere logging test jupiter extension logging LoggingLevelTemplateInvocationContext
Type: Class | Module: microsphere-logging-test | Package: io.microsphere.logging.test.jupiter.extension.logging | Since: 1.0.0
The facade class of ClassTemplateInvocationContext and TestTemplateInvocationContext to set the
logging level.
class LoggingLevelTemplateInvocationContext implements ClassTemplateInvocationContext, TestTemplateInvocationContextAuthor: Mercy
-
Introduced in:
1.0.0 -
Current Project Version:
0.1.14-SNAPSHOT
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 |
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]"LoggingLevelTemplateInvocationContext ctx = ...;
List<Extension> extensions = ctx.getAdditionalExtensions();LoggingLevelTemplateInvocationContext ctx = ...;
ctx.prepareInvocation(extensionContext);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 io.microsphere.logging.test.jupiter.extension.logging.LoggingLevelTemplateInvocationContext;| Method | Description |
|---|---|
getDisplayName |
Creates a new LoggingLevelTemplateInvocationContext. |
getAdditionalExtensions |
{@inheritDoc} |
prepareInvocation |
Prepares the invocation context before each test execution. |
public String getDisplayName(int invocationIndex)Creates a new LoggingLevelTemplateInvocationContext.
`List loggings = LoggingUtils.loadAll();
LoggingLevelTemplateInvocationContext ctx =
new LoggingLevelTemplateInvocationContext(loggings, new String[]{"io.microsphere"`, "DEBUG", 0, false);
}
public List<Extension> getAdditionalExtensions(){@inheritDoc}
`LoggingLevelTemplateInvocationContext ctx = ...; List extensions = ctx.getAdditionalExtensions(); `
public void prepareInvocation(ExtensionContext context)Prepares the invocation context before each test execution.
`LoggingLevelTemplateInvocationContext ctx = ...; ctx.prepareInvocation(extensionContext); `
ClassTemplateInvocationContextTestTemplateInvocationContext
This documentation was auto-generated from the source code of microsphere-logging.
java-logging
log4j
log4j2
- DelegatingLayout
- InMemoryAppender
- Log4j2Logger
- Log4j2LoggerFactory
- Log4j2Logging
- Log4j2Utils
- LogEventComparator
- SmartFileAppenderLayout
logback
logging-commons
- DefaultLoggingLevelsResolver
- Logging
- LoggingLevelsResolver
- LoggingMXBeanAdapter
- LoggingMXBeanRegistrar
- LoggingUtils
logging-examples
logging-test