{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/4757","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/4757/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/4757/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/4757/events","html_url":"https://github.com/gradle/gradle/issues/4757","id":306270028,"number":4757,"title":"Unable to get debug log messages in test-kit ","user":{"login":"jansauer","id":143302,"avatar_url":"https://avatars3.githubusercontent.com/u/143302?v=4","gravatar_id":"","url":"https://api.github.com/users/jansauer","html_url":"https://github.com/jansauer","followers_url":"https://api.github.com/users/jansauer/followers","following_url":"https://api.github.com/users/jansauer/following{/other_user}","gists_url":"https://api.github.com/users/jansauer/gists{/gist_id}","starred_url":"https://api.github.com/users/jansauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jansauer/subscriptions","organizations_url":"https://api.github.com/users/jansauer/orgs","repos_url":"https://api.github.com/users/jansauer/repos","events_url":"https://api.github.com/users/jansauer/events{/privacy}","received_events_url":"https://api.github.com/users/jansauer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-18T18:55:43Z","updated_at":"2018-03-19T18:21:09Z","closed_at":"2018-03-19T18:21:09Z","author_association":"NONE","body":"When writing gradle plugins gradle runner output is missing debug log messages when run with ` .withDebug(true)`.\r\n\r\n### Expected Behavior\r\nLogged debug messages should be in the `GradleRunner` output.\r\n\r\n### Current Behavior\r\nLogged debug messages are missing\r\n\r\n### Steps to Reproduce (for bugs)\r\nRun this test case:\r\n```\r\n  def \"log a debug message\"() {\r\n    given:\r\n    buildFile << \"\"\"\r\n            task helloWorld {\r\n                doLast {\r\n                    logger.debug 'Hello world!'\r\n                }\r\n            }\r\n        \"\"\"\r\n\r\n    when:\r\n    def result = GradleRunner.create()\r\n        .withProjectDir(testProjectDir.root)\r\n        .withArguments('helloWorld')\r\n        .withDebug(true)\r\n        .withPluginClasspath()\r\n        .forwardOutput()\r\n        .build()\r\n\r\n    then:\r\n    result.output.contains('Hello world!')\r\n    result.task(\":helloWorld\").outcome == SUCCESS\r\n  }\r\n```\r\n\r\n### Spark\r\n\r\nMaybe [ToolingApiGradleExecutor.java#L177](https://github.com/gradle/gradle/blob/master/subprojects/test-kit/src/main/java/org/gradle/testkit/runner/internal/ToolingApiGradleExecutor.java#L177) should also call [setVerboseLogging](https://github.com/gradle/gradle/blob/master/subprojects/tooling-api/src/main/java/org/gradle/tooling/internal/consumer/DefaultGradleConnector.java#L124) with the debug parameter from the runner.\r\n\r\n### Your Environment\r\nGradle 4.6\r\ncom.gradle.plugin-publish 0.9.10\r\n"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/374315105","html_url":"https://github.com/gradle/gradle/issues/4757#issuecomment-374315105","issue_url":"https://api.github.com/repos/gradle/gradle/issues/4757","id":374315105,"user":{"login":"big-guy","id":5387972,"avatar_url":"https://avatars0.githubusercontent.com/u/5387972?v=4","gravatar_id":"","url":"https://api.github.com/users/big-guy","html_url":"https://github.com/big-guy","followers_url":"https://api.github.com/users/big-guy/followers","following_url":"https://api.github.com/users/big-guy/following{/other_user}","gists_url":"https://api.github.com/users/big-guy/gists{/gist_id}","starred_url":"https://api.github.com/users/big-guy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/big-guy/subscriptions","organizations_url":"https://api.github.com/users/big-guy/orgs","repos_url":"https://api.github.com/users/big-guy/repos","events_url":"https://api.github.com/users/big-guy/events{/privacy}","received_events_url":"https://api.github.com/users/big-guy/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T18:21:09Z","updated_at":"2018-03-19T18:21:09Z","author_association":"MEMBER","body":"This is working as intended.\r\n\r\n`withDebug` refers to whether or not the build under test can be connected to with a debugger:\r\nhttps://github.com/gradle/gradle/blob/7c09b6dc6a8d3b703df3fbf46d2122956da9b12f/subprojects/test-kit/src/main/java/org/gradle/testkit/runner/GradleRunner.java#L274-L288\r\n\r\nIf you would like to see debug-level logging, you can pass `--debug` to the build under test:\r\n```\r\n    def result = GradleRunner.create()\r\n        .withProjectDir(testProjectDir.root)\r\n        .withArguments('helloWorld', '--debug')\r\n        .withDebug(true)\r\n        .withPluginClasspath()\r\n        .forwardOutput()\r\n        .build()\r\n```\r\n"}}
{"actor":{"display_login":"big-guy"}}