interface TestLoggingContainer : TestLogging
Container for all test logging related options. Different options can be set for each log level. Options that are set directly (without specifying a log level) apply to log level LIFECYCLE. Example:
apply plugin: 'java' test { testLogging { // set options for log level LIFECYCLE events "failed" exceptionFormat "short" // set options for log level DEBUG debug { events "started", "skipped", "failed" exceptionFormat "full" } // remove standard output/error logging from --info builds // by assigning only 'failed' and 'skipped' events info.events = ["failed", "skipped"] } }
The defaults that are in place show progressively more information on log levels WARN, LIFECYCLE, INFO, and DEBUG, respectively.
abstract fun debug(action: Action<TestLogging>): Unit
Configures logging options for debug level. |
|
abstract fun error(action: Action<TestLogging>): Unit
Configures logging options for error level. |
|
abstract fun get(level: LogLevel): TestLogging
Returns logging options for the specified level. |
|
abstract fun getDebug(): TestLogging
Returns logging options for debug level. |
|
abstract fun getError(): TestLogging
Returns logging options for error level. |
|
abstract fun getInfo(): TestLogging
Gets logging options for info level. |
|
abstract fun getLifecycle(): TestLogging
Returns logging options for lifecycle level. |
|
abstract fun getQuiet(): TestLogging
Returns logging options for quiet level. |
|
abstract fun getWarn(): TestLogging
Gets logging options for warn level. |
|
abstract fun info(action: Action<TestLogging>): Unit
Configures logging options for info level. |
|
abstract fun lifecycle(action: Action<TestLogging>): Unit
Configures logging options for lifecycle level. |
|
abstract fun quiet(action: Action<TestLogging>): Unit
Configures logging options for quiet level. |
|
abstract fun setDebug(logging: TestLogging): Unit
Sets logging options for debug level. |
|
abstract fun setError(logging: TestLogging): Unit
Sets logging options for error level. |
|
abstract fun setInfo(logging: TestLogging): Unit
Sets logging options for info level. |
|
abstract fun setLifecycle(logging: TestLogging): Unit
Sets logging options for lifecycle level. |
|
abstract fun setQuiet(logging: TestLogging): Unit
Sets logging options for quiet level. |
|
abstract fun setWarn(logging: TestLogging): Unit
Sets logging options for warn level. |
|
abstract fun warn(action: Action<TestLogging>): Unit
Configures logging options for warn level. |
abstract fun events(vararg events: Any): Unit
Sets the events to be logged. Events can be passed as enum values (e.g. |
|
abstract fun getDisplayGranularity(): Int
Returns the display granularity of the events to be logged. For example, if set to 0, a method-level event will be displayed as "Test Run > Test Worker x > org.SomeClass > org.someMethod". If set to 2, the same event will be displayed as "org.someClass > org.someMethod". -1 denotes the highest granularity and corresponds to an atomic test. |
|
abstract fun getEvents(): MutableSet<TestLogEvent>
Returns the events to be logged. |
|
abstract fun getExceptionFormat(): TestExceptionFormat
Returns the format to be used for logging test exceptions. Only relevant if |
|
abstract fun getMaxGranularity(): Int
Returns the maximum granularity of the events to be logged. Typically, 0 corresponds to the Gradle-generated test suite for the whole test run, 1 corresponds to the Gradle-generated test suite for a particular test JVM, 2 corresponds to a test class, and 3 corresponds to a test method. These values will vary if user-defined suites are executed. -1 denotes the highest granularity and corresponds to an atomic test. |
|
abstract fun getMinGranularity(): Int
Returns the minimum granularity of the events to be logged. Typically, 0 corresponds to the Gradle-generated test suite for the whole test run, 1 corresponds to the Gradle-generated test suite for a particular test JVM, 2 corresponds to a test class, and 3 corresponds to a test method. These values will vary if user-defined suites are executed. -1 denotes the highest granularity and corresponds to an atomic test. |
|
abstract fun getShowCauses(): Boolean
Tells whether causes of exceptions that occur during test execution will be logged. Only relevant if |
|
abstract fun getShowExceptions(): Boolean
Tells whether exceptions that occur during test execution will be logged. Typically these exceptions coincide with a "failed" event. |
|
abstract fun getShowStackTraces(): Boolean
Tells whether stack traces of exceptions that occur during test execution will be logged. |
|
abstract fun getShowStandardStreams(): Boolean
Tells whether output on standard out and standard error will be logged. Equivalent to checking if both log events |
|
abstract fun getStackTraceFilters(): MutableSet<TestStackTraceFilter>
Returns the set of filters to be used for sanitizing test stack traces. |
|
abstract fun setDisplayGranularity(granularity: Int): Unit
Sets the display granularity of the events to be logged. For example, if set to 0, a method-level event will be displayed as "Test Run > Test Worker x > org.SomeClass > org.someMethod". If set to 2, the same event will be displayed as "org.someClass > org.someMethod". -1 denotes the highest granularity and corresponds to an atomic test. |
|
abstract fun setEvents(events: MutableSet<TestLogEvent>): Unit abstract fun setEvents(events: MutableIterable<*>): Unit
Sets the events to be logged. |
|
abstract fun setExceptionFormat(exceptionFormat: TestExceptionFormat): Unit abstract fun setExceptionFormat(exceptionFormat: Any): Unit
Sets the format to be used for logging test exceptions. Only relevant if |
|
abstract fun setMaxGranularity(granularity: Int): Unit
Returns the maximum granularity of the events to be logged. Typically, 0 corresponds to the Gradle-generated test suite for the whole test run, 1 corresponds to the Gradle-generated test suite for a particular test JVM, 2 corresponds to a test class, and 3 corresponds to a test method. These values will vary if user-defined suites are executed. -1 denotes the highest granularity and corresponds to an atomic test. |
|
abstract fun setMinGranularity(granularity: Int): Unit
Sets the minimum granularity of the events to be logged. Typically, 0 corresponds to the Gradle-generated test suite for the whole test run, 1 corresponds to the Gradle-generated test suite for a particular test JVM, 2 corresponds to a test class, and 3 corresponds to a test method. These values will vary if user-defined suites are executed. -1 denotes the highest granularity and corresponds to an atomic test. |
|
abstract fun setShowCauses(flag: Boolean): Unit
Sets whether causes of exceptions that occur during test execution will be logged. Only relevant if |
|
abstract fun setShowExceptions(flag: Boolean): Unit
Sets whether exceptions that occur during test execution will be logged. |
|
abstract fun setShowStackTraces(flag: Boolean): Unit
Sets whether stack traces of exceptions that occur during test execution will be logged. |
|
abstract fun setShowStandardStreams(flag: Boolean): TestLogging
Sets whether output on standard out and standard error will be logged. Equivalent to setting log events |
|
abstract fun setStackTraceFilters(stackTraces: MutableSet<TestStackTraceFilter>): Unit abstract fun setStackTraceFilters(stackTraces: MutableIterable<*>): Unit
Sets the set of filters to be used for sanitizing test stack traces. |
|
abstract fun stackTraceFilters(vararg stackTraces: Any): Unit
Convenience method for |