title: Java: using a logger in JUnit assert*
body: <p>What I want to do is something like the following in JUnit:</p>
  
  <pre><code>assertTrue(logger.error("the condition is not true"), &lt;a boolean condition&gt;);
  </code></pre>
  
  <p>so the error message gets logged by a logger, where the logger could be e.g. commons or log4j.</p>
  
  <p>But Junit asserts don't take a logger param, so is there some way to achieve this, or do I need to try-catch the assert and log the error message in catch block?</p>