小编Jay*_* F.的帖子

无法解析符号 testLogging、事件、异常格式- Gradle

我试图按照这篇文章将更多日志打印到我的控制台: /sf/answers/2529132721/,但我不断收到这些错误:

  1. 无法解析符号 testLogging
  2. 无法解析符号事件
  3. 无法解析符号异常格式
  4. 无法解析符号调试等。

这是我的代码

构建.gradle 文件:

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

    apply plugin: 'groovy'
    apply plugin: 'idea'
    apply plugin: 'java'

    repositories {
        jcenter()
        mavenCentral()
    }


    tasks.withType(Test) {


        testLogging {
            // set options for log level LIFECYCLE
            events TestLogEvent.FAILED,
                    TestLogEvent.PASSED,
                    TestLogEvent.SKIPPED,
                    TestLogEvent.STANDARD_OUT
            exceptionFormat TestExceptionFormat.FULL
            showExceptions true
            showCauses true
            showStackTraces true

            // set options for log level DEBUG and INFO
            debug {
                events TestLogEvent.STARTED,
                        TestLogEvent.FAILED,
                        TestLogEvent.PASSED,
                        TestLogEvent.SKIPPED,
                        TestLogEvent.STANDARD_ERROR,
                        TestLogEvent.STANDARD_OUT
                exceptionFormat TestExceptionFormat.FULL
            }
            info.events = debug.events
            info.exceptionFormat = debug.exceptionFormat …
Run Code Online (Sandbox Code Playgroud)

gradle

5
推荐指数
1
解决办法
2148
查看次数

标签 统计

gradle ×1