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

Avoid printing duplicated messages when LoggerRule is used #138

Merged
merged 1 commit into from
Jun 13, 2019

Conversation

jglick
Copy link
Member

@jglick jglick commented Jun 12, 2019

LoggerRule has two basic functions:

  • Let you see FINE or lower messages from particular loggers in test output. (record)
  • Keep track of messages so you can assert things about them. (capture)

For the record aspect, there was an unfortunate side effect that messages to those loggers at INFO or above got printed once for the general system logger (formatted nicely by JenkinsRule), plus once per matching LoggerRule. So the test output would get multiple copies of lots of messages, which was harmless but irritating.

Not trivially testable, but tried it interactively in jenkinsci/kubernetes-plugin#503 and it seemed to do the job.

@oleg-nenashev
Copy link
Member

some description would be nice

@jglick
Copy link
Member Author

jglick commented Jun 13, 2019

Sorry, thought the commit message plus comment would explain themselves, but I guess this more subtle than that. Will add a PR description.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation!

@oleg-nenashev oleg-nenashev merged commit 9835033 into jenkinsci:master Jun 13, 2019
@jglick jglick deleted the LoggerRule branch June 13, 2019 19:39
jglick added a commit to jglick/jenkins-test-harness that referenced this pull request Jul 1, 2019
jglick added a commit that referenced this pull request Jul 1, 2019
Reverting #138 as it broke display of FINE- messages
@jglick jglick mentioned this pull request Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants