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

Log the time offset warning at INFO if time not exceeded #40

Conversation

urbanautomaton
Copy link
Contributor

Hi @ArturT - thanks for releasing the last logging PR, my colleagues are really happy with the cleaner test output. 👍

There's one more source of regular output that we'd like to suppress if possible, which is the time offset warning. Currently, at the end of every suite run, the node's time offset warning is logged at WARN level. However, if the allowed time offset is not exceeded, this doesn't require user action, so we'd quite like to suppress it.

This change modifies the reporting calls to log the message at INFO level if the time offset is not exceeded, and WARN if it is exceeded. This allows a user to set their log level to WARN, and receive the message only when they need to rebalance their knapsack timing report.

I hope the approach is okay - I considered pushing the logger calls into the Presenter class itself (because there's a degree of duplication between the different adapters), but that didn't seem like a presentational responsibility, so I left it as-is. If you'd prefer another solution, though, just let me know.

Currently, at the end of every suite run, the node's time offset warning is
logged at WARN level. However, in the event that the allowed time offset is
not exceeded, this does not require user action.

This change modifies the reporting calls to log the message at INFO level if
the time offset is not exceeded, and WARN if it is exceeded. This allows a
user to set their log level to WARN, and receive the message only when they
need to rebalance their knapsack timing report.
@ArturT ArturT merged commit 46d9098 into KnapsackPro:master Jun 1, 2016
@ArturT
Copy link
Member

ArturT commented Jun 1, 2016

Nice work. Thanks! I've released knapsack 1.10.0.

BTW If you would find some time to try http://knapsackpro.com then I would be grateful to get some feedback from you about knapsack_pro gem. I added recently dashboard on the page so you can generate multiple API tokens for each of your test suites.

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.

2 participants