Skip to content

Conversation

@SquirrelGrip
Copy link

Hi,
I really like the slf4j-test implementation of slf4j and it gets around a number of issues for testing logging in any environment.

But I am partial to JUnit Rules.
I prefer to setup up expectations in a rule and then have the rule take care of it for me. Plus I don't have to clear the logger (although I did see the Rule that was there to do that for me).

I have some more ideas around this rule feature:

  • Strict/lazy checking (strict would fail if you had unexpected logs, lazy would fail if had expected logs and they were not logged, but wouldn't care if their were other logs).
  • Regular expression matching of messages.
  • Level At Least (atLeast(INFO), which would pass if the Level was Info, Warn, Error, etc)
  • Ability to control the expected level from the Rule

Just some of them
Adrian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant