将消息记录到JUnit控制台 [英] Log messages to JUnit console

查看:270
本文介绍了将消息记录到JUnit控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,当我编写单元测试时,在JUnit控制台(我使用IntelliJ,但我认为Eclipse非常相似)中有日志消息并在运行测试时看到它们是有用的。

Sometimes as I'm writing unit tests it's useful to have log messages, and see them when I run the tests, in the JUnit console (I'm using IntelliJ, but I think Eclipse is very similar).

问题是System.out.println不起作用。有没有人有关于如何将日志消息打印到JUnit控制台的任何提示?

The problem is that System.out.println doesn't work. Does anyone have any tips on how to print log messages to the JUnit console?

推荐答案

您应该在树中选择测试左侧在右侧控制台中查看其输出:

You should select the test in the tree on the left to see its output in the console on the right:

这篇关于将消息记录到JUnit控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆