# TestLoggingContainer

interface TestLoggingContainer : TestLogging(source)

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"]
        }
    }

Content copied to clipboard
The defaults that are in place show progressively more information on log levels WARN, LIFECYCLE, INFO, and DEBUG, respectively.

#### Since

1.1

## Functions

debug
Link copied to clipboard
abstract fun debug(action: Action<TestLogging>)
Configures logging options for debug level.
error
Link copied to clipboard
abstract fun error(action: Action<TestLogging>)
Configures logging options for error level.
events
Link copied to clipboard
abstract fun events(events: Array<Any>)
Sets the events to be logged.
get
Link copied to clipboard
abstract fun get(level: LogLevel): TestLogging
Returns logging options for the specified level.
getDebug
Link copied to clipboard
@Internal
abstract fun getDebug(): TestLogging
Returns logging options for debug level.
getDisplayGranularity
Link copied to clipboard
@Internal
abstract fun getDisplayGranularity(): Int
Returns the display granularity of the events to be logged.
getError
Link copied to clipboard
@Internal
abstract fun getError(): TestLogging
Returns logging options for error level.
getEvents
Link copied to clipboard
@Internal
abstract fun getEvents(): Set<TestLogEvent>
Returns the events to be logged.
getExceptionFormat
Link copied to clipboard
@Internal
abstract fun getExceptionFormat(): TestExceptionFormat
Returns the format to be used for logging test exceptions.
getInfo
Link copied to clipboard
@Internal
abstract fun getInfo(): TestLogging
Gets logging options for info level.
getLifecycle
Link copied to clipboard
@Internal
abstract fun getLifecycle(): TestLogging
Returns logging options for lifecycle level.
getMaxGranularity
Link copied to clipboard
@Internal
abstract fun getMaxGranularity(): Int
Returns the maximum granularity of the events to be logged.
getMinGranularity
Link copied to clipboard
@Internal
abstract fun getMinGranularity(): Int
Returns the minimum granularity of the events to be logged.
getQuiet
Link copied to clipboard
@Internal
abstract fun getQuiet(): TestLogging
Returns logging options for quiet level.
getShowCauses
Link copied to clipboard
@Internal
abstract fun getShowCauses(): Boolean
Tells whether causes of exceptions that occur during test execution will be logged.
getShowExceptions
Link copied to clipboard
@Internal
abstract fun getShowExceptions(): Boolean
Tells whether exceptions that occur during test execution will be logged.
getShowStackTraces
Link copied to clipboard
@Internal
abstract fun getShowStackTraces(): Boolean
Tells whether stack traces of exceptions that occur during test execution will be logged.
getShowStandardStreams
Link copied to clipboard
@Internal
abstract fun getShowStandardStreams(): Boolean
Tells whether output on standard out and standard error will be logged.
getStackTraceFilters
Link copied to clipboard
@Internal
abstract fun getStackTraceFilters(): Set<TestStackTraceFilter>
Returns the set of filters to be used for sanitizing test stack traces.
getWarn
Link copied to clipboard
@Internal
abstract fun getWarn(): TestLogging
Gets logging options for warn level.
info
Link copied to clipboard
abstract fun info(action: Action<TestLogging>)
Configures logging options for info level.
lifecycle
Link copied to clipboard
abstract fun lifecycle(action: Action<TestLogging>)
Configures logging options for lifecycle level.
quiet
Link copied to clipboard
abstract fun quiet(action: Action<TestLogging>)
Configures logging options for quiet level.
setDebug
Link copied to clipboard
abstract fun setDebug(logging: TestLogging)
Sets logging options for debug level.
setDisplayGranularity
Link copied to clipboard
abstract fun setDisplayGranularity(granularity: Int)
Sets the display granularity of the events to be logged.
setError
Link copied to clipboard
abstract fun setError(logging: TestLogging)
Sets logging options for error level.
setEvents
Link copied to clipboard
abstract fun setEvents(events: Iterable<out Any>)
abstract fun setEvents(events: Set<TestLogEvent>)
Sets the events to be logged.
setExceptionFormat
Link copied to clipboard
abstract fun setExceptionFormat(exceptionFormat: Any)
abstract fun setExceptionFormat(exceptionFormat: TestExceptionFormat)
Sets the format to be used for logging test exceptions.
setInfo
Link copied to clipboard
abstract fun setInfo(logging: TestLogging)
Sets logging options for info level.
setLifecycle
Link copied to clipboard
abstract fun setLifecycle(logging: TestLogging)
Sets logging options for lifecycle level.
setMaxGranularity
Link copied to clipboard
abstract fun setMaxGranularity(granularity: Int)
Returns the maximum granularity of the events to be logged.
setMinGranularity
Link copied to clipboard
abstract fun setMinGranularity(granularity: Int)
Sets the minimum granularity of the events to be logged.
setQuiet
Link copied to clipboard
abstract fun setQuiet(logging: TestLogging)
Sets logging options for quiet level.
setShowCauses
Link copied to clipboard
abstract fun setShowCauses(flag: Boolean)
Sets whether causes of exceptions that occur during test execution will be logged.
setShowExceptions
Link copied to clipboard
abstract fun setShowExceptions(flag: Boolean)
Sets whether exceptions that occur during test execution will be logged.
setShowStackTraces
Link copied to clipboard
abstract fun setShowStackTraces(flag: Boolean)
Sets whether stack traces of exceptions that occur during test execution will be logged.
setShowStandardStreams
Link copied to clipboard
abstract fun setShowStandardStreams(flag: Boolean): TestLogging
Sets whether output on standard out and standard error will be logged.
setStackTraceFilters
Link copied to clipboard
abstract fun setStackTraceFilters(stackTraces: Iterable<out Any>)
abstract fun setStackTraceFilters(stackTraces: Set<TestStackTraceFilter>)
Sets the set of filters to be used for sanitizing test stack traces.
setWarn
Link copied to clipboard
abstract fun setWarn(logging: TestLogging)
Sets logging options for warn level.
stackTraceFilters
Link copied to clipboard
abstract fun stackTraceFilters(stackTraces: Array<Any>)
Convenience method for setStackTraceFilters.
warn
Link copied to clipboard
abstract fun warn(action: Action<TestLogging>)
Configures logging options for warn level.