{"repo":"netmikey/logunit","free":true,"listed":false,"github":"https://github.com/netmikey/logunit","clone":"git clone https://github.com/netmikey/logunit.git","description":"A Java library for unit-testing logging.","language":"Java","stars":53,"topics":["slf4j","unit-testing","logging","test","logback","java"],"license":"Apache-2.0","category":"analytics","readme_excerpt":"LogUnit ======= A Java library for unit-testing logging. Purpose Sometimes, writing specific information into its log(file) is an important part of an application's functionality. As such, it's probably a good idea to cover that behavior in the application's unit tests. Although there are other solutions to achieve this (like e.g. using mocks and test for the methods to be called), LogUnit aims at testing on another level: right within the logging framework, so you can still see all your logs while testing. No matter how you generate your log messages in your project, if they end up in one of the supported logging frameworks, you can use LogUnit. Requirements - Java 8 or above - JUnit 5 - You must be using one of the supported logging frameworks at test runtime - You may use Slf4j or your logging framework's native API (or anything else that makes your log events end up in your logging framework at runtime) Supported logging frameworks - java.util.logging (the JDK's logging API) - Logback - Log4j2 Limitations Because of the very nature of how logging frameworks work, LogUnit cannot be used with parallel test execution. See this issue for a more detailed explanation. Installation Add LogUnit to your project's dependencies. Declare logunit-core as compile-time dependency Declare the binding-specific module (e.g. logunit-logback , logunit-log4j2 or logunit-jul ) as test-runtime dependency Usage Let's say we have a unit to be tested that looks something like this: Within MyModule","default_branch":null,"files":null,"tree":[],"storefront":"/r/netmikey","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/netmikey/logunit/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}