Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TestLoggerRule #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added TestLoggerRule #18

wants to merge 1 commit into from

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