When things go wrong with your application, the first thing you turn to are your logs. But, even if you use TDD, this is the one thing you are least likely to have tested. This increases the likelihood that your logs may not be anywhere near as useful as you might want them to be.
logspec is a a Scala library I just wrote that allows you to treat your logging as a first-class feature and unit test them.
This little utility was inspired by a similar library in Go called glager
logspec can be downloaded from Github. In the next few days, I should get
logspec released on the Maven Central repository (once Sonatype approve my New Project request).
If you want to use it before it's out on Maven Central (or if I never get around to doing it because my laziness is legendary), please download the project and run the following from the root of the project (you need Maven 3 and JDK 7 installed):
mvn install -Dgpg.skip=true
logspec has been built and tested on Scala 2.11 and currently only supports
logback, but if time permits (or somebody sends me a Pull Request), I hope to support other logging frameworks such as
If you're wondering how you can use
logspec (or whether you want to use it at all), please check out the README file on Github.
If you find any issues with the product, please file an issue on the Github project.