TestLoggingContainer

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.

Functions

Link copied to clipboard
abstract fun debug(action: Action<TestLogging>)
Configures logging options for debug level.
Link copied to clipboard
abstract fun error(action: Action<TestLogging>)
Configures logging options for error level.
Link copied to clipboard
abstract fun events(events: Array<Any>)
Link copied to clipboard
abstract fun get(level: LogLevel): TestLogging
Returns logging options for the specified level.
Link copied to clipboard
abstract fun getDebug(): TestLogging
Returns logging options for debug level.
Link copied to clipboard
abstract fun getDisplayGranularity(): Int
Link copied to clipboard
abstract fun getError(): TestLogging
Returns logging options for error level.
Link copied to clipboard
abstract fun getEvents(): Set<TestLogEvent>
Link copied to clipboard
Link copied to clipboard
abstract fun getInfo(): TestLogging
Gets logging options for info level.
Link copied to clipboard
Returns logging options for lifecycle level.
Link copied to clipboard
abstract fun getMaxGranularity(): Int
Link copied to clipboard
abstract fun getMinGranularity(): Int
Link copied to clipboard
abstract fun getQuiet(): TestLogging
Returns logging options for quiet level.
Link copied to clipboard
abstract fun getShowCauses(): Boolean
Link copied to clipboard
abstract fun getShowExceptions(): Boolean
Link copied to clipboard
abstract fun getShowStackTraces(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun getWarn(): TestLogging
Gets logging options for warn level.
Link copied to clipboard
abstract fun info(action: Action<TestLogging>)
Configures logging options for info level.
Link copied to clipboard
abstract fun lifecycle(action: Action<TestLogging>)
Configures logging options for lifecycle level.
Link copied to clipboard
abstract fun quiet(action: Action<TestLogging>)
Configures logging options for quiet level.
Link copied to clipboard
abstract fun setDebug(logging: TestLogging)
Sets logging options for debug level.
Link copied to clipboard
abstract fun setDisplayGranularity(granularity: Int)
Link copied to clipboard
abstract fun setError(logging: TestLogging)
Sets logging options for error level.
Link copied to clipboard
abstract fun setEvents(events: Set<TestLogEvent>)
Link copied to clipboard
abstract fun setExceptionFormat(exceptionFormat: TestExceptionFormat)
Link copied to clipboard
abstract fun setInfo(logging: TestLogging)
Sets logging options for info level.
Link copied to clipboard
abstract fun setLifecycle(logging: TestLogging)
Sets logging options for lifecycle level.
Link copied to clipboard
abstract fun setMaxGranularity(granularity: Int)
Link copied to clipboard
abstract fun setMinGranularity(granularity: Int)
Link copied to clipboard
abstract fun setQuiet(logging: TestLogging)
Sets logging options for quiet level.
Link copied to clipboard
abstract fun setShowCauses(flag: Boolean)
Link copied to clipboard
abstract fun setShowExceptions(flag: Boolean)
Link copied to clipboard
abstract fun setShowStackTraces(flag: Boolean)
Link copied to clipboard
Link copied to clipboard
abstract fun setStackTraceFilters(stackTraces: Set<TestStackTraceFilter>)
Link copied to clipboard
abstract fun setWarn(logging: TestLogging)
Sets logging options for warn level.
Link copied to clipboard
abstract fun stackTraceFilters(stackTraces: Array<Any>)
Link copied to clipboard
abstract fun warn(action: Action<TestLogging>)
Configures logging options for warn level.