开发者

java.util.logging Using ConsoleHandler & not seeing system.err output in IntelliJ IDEA 9 or Mac Terminal window

I've been trying to run an integration test based on GroovyTestCase. It's got a built in log property according to API docs. I was initially trying to log an info message as a test was running, using this site as a reference. I was surprised my logging messages were never displaying in the Console in IntelliJ9, so I tried running my integration test on my Mac from the Terminal window. Still I didn't see any output, even though my code had set the logging level to ALL and I was using the ConsoleHandler.

I'd almost given up on this, but noticed a message in the terminal window, that said my failed tests were in the target/test-reports folder.

Oddly I can't even see the target folder in the the Project Explorer window of Int开发者_高级运维elliJ9, irrespective of the view as option I take. So I guess that's one question I'd like to solve.

Anyway I tracked down the error report, and when I drill down into the failed test of the HTML report, there's a link to system.err and voila. There's my output I'd been expecting to see all along! So the second part of this is, is there some sort of UNIX system.err redirect to system.out I need to do in order to see this output in my IDE?

Any ideas?

I figured out how to display the target folder... Project Structure -> Modules -> Excluded folders click x against target under excluded section (to left of folders) You can remove it again by Project Structure -> Modules -> click on 'target' folder then the Excluded button above folders list


See GRAILS-7012. log in the GroovyTestCase is java.util.logging, not log4j. You should define your own logger and use it instead. Built-in GroovyTestCase logger has hardcoded configuration to produce files for stderr and stdout in HTML, XML and plain text formats (it runs tests intercepting all the output and generating files in different formats using custom XSL -- junit-frames.xsl).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜