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

[MNG-6891] Improve user-friendliness --fail-on-severity #337

Merged
merged 3 commits into from May 3, 2020

Conversation

mthmulders
Copy link
Contributor

Following this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. See MNG-6891.

  • Each commit in the pull request should have a meaningful subject line and body.

  • Format the pull request title like [MNG-XXX] - Fixes bug in ApproximateQuantiles, where you replace MNG-XXX with the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message.

  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.

  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.

  • You have run the Core IT successfully. There's one test case that fails (testitMNG6386UnicodeChars) but it also fails on master.

  • If your pull request is about ~20 lines of code you don't need to sign an Individual Contributor License Agreement if you are unsure please ask on the developers list. ICLA and CCLA have been signed

To make clear that you license your contribution under the Apache License Version 2.0, January 2004 you have to acknowledge this by using the following check-box.

@michael-o
Copy link
Member

Looks incomplete, what about? ERROR(ERROR_INT, "ERROR"), WARN(WARN_INT, "WARN"), INFO(INFO_INT, "INFO"), DEBUG(DEBUG_INT, "DEBUG"), TRACE(TRACE_INT, "TRACE");

@mthmulders
Copy link
Contributor Author

This merge request is only addressing the first part of MNG-6891. I'm planning to do the second part (support WARNING as well) in a follow-up.

@mthmulders mthmulders marked this pull request as ready for review April 15, 2020 13:35
@mthmulders mthmulders changed the title [MNG-6891] Improve user-friendliness of error message [MNG-6891] Improve user-friendliness --fail-on-severity Apr 15, 2020
@mthmulders
Copy link
Contributor Author

On second thought, I'll add the remainder of MNG-6891 to this merge request, too. That is, the part that says "it'd be nice if WARNING was accepted next to WARN".

Since this feature hasn't been released yet, I took the liberty to change the message for severity levels that we don't accept for --fos. Instead of "Logging severity thresholds can only be set to WARN or ERROR" it'll now give the same message "INFO is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.".

This shouldn't break anything, as the feature hasn't been released yet, but makes the code a little easier to read, and it saves us one try/catch.

@rfscholte rfscholte merged commit 70cee55 into apache:master May 3, 2020
private final Level logThreshold;
private boolean metThreshold = false;

public LogLevelRecorder( String threshold )
{
Level level = Level.valueOf( threshold );
Level level = determineThresholdLevel( threshold );

if ( level.toInt() < Level.WARN.toInt() )
Copy link

Choose a reason for hiding this comment

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

Then this won't be executed, I make a pr to delete this. #360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants