You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/05/19 12:24:18 UTC

[GitHub] [maven] gnodet opened a new pull request #473: [MNG-6915] Adapt the logging width to the terminal width, including s…

gnodet opened a new pull request #473:
URL: https://github.com/apache/maven/pull/473


   …ensible limits.
   
   Slightly modified version of https://github.com/apache/maven/pull/472 / https://github.com/apache/maven/pull/472/commits/e47d647eee04888713a1875ddadf2ae1f28bc94e
   
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) 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.
    - [ ] 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][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] gnodet commented on pull request #473: [MNG-6915] Adapt the logging width to the terminal width, including s…

Posted by GitBox <gi...@apache.org>.
gnodet commented on pull request #473:
URL: https://github.com/apache/maven/pull/473#issuecomment-844793089


   @MartinKanters it seems to work.  I've forced pushed the change.
   
   Fwiw, there is a minor problem with the terminal width which can be improved later: ideally, we'd make the difference between the `System.out` and `System.err` streams.  Currently, `MessageUtils.getTerminalWidth()` relies on `AnsiConsole.getTerminalWidth()` which first tries the get the width of the terminal using `System.out` and then try with `System.err`.  The downside is that if the output is redirected using `mvn > out.txt` or even simply `mvn -l out.txt`, then the computed terminal width is not relevant.  It's no big deal though.  This also makes we wonder if the `MavenCli` should use `System.err` to print non standard output (i.e. version, help, etc...) instead of `System.out`...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] MartinKanters commented on pull request #473: [MNG-6915] Adapt the logging width to the terminal width, including s…

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on pull request #473:
URL: https://github.com/apache/maven/pull/473#issuecomment-846207490


   [Running the build on Jenkins](https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven/job/MNG-6915/2/). First try failed because of an infra issue, I think.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] gnodet commented on pull request #473: [MNG-6915] Adapt the logging width to the terminal width, including s…

Posted by GitBox <gi...@apache.org>.
gnodet commented on pull request #473:
URL: https://github.com/apache/maven/pull/473#issuecomment-844864096


   > > @MartinKanters it seems to work. I've forced pushed the change.
   > 
   > Nice, I definitely prefer defaulting to the old width. I see that you are not targeting any customized ITs and removed the changes in the unit tests. To me that proves that it's backwards compatible for non-ansi terminals.
   > And now that we have a constructor where we can put in the values, we can create some unit tests which verify that the terminal width is set correctly in all scenarios. I'm sorry that I'm asking for more changes on a PR that @mthmulders and I initially delivered... :)
   
   I've added a test to check various terminal widths.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] MartinKanters commented on pull request #473: [MNG-6915] Adapt the logging width to the terminal width, including s…

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on pull request #473:
URL: https://github.com/apache/maven/pull/473#issuecomment-844764826


   Looks good to me! 
   
   Didn't think of this last time, but I'm wondering, when Jansi cannot determine the width, whether we should fallback the width of the terminal equal to the 'old' terminal width of 80 (I believe?). Then we are backwards-compatible for non-jansi terminals and probably would not have to change any ITs and unit tests. What do you think? And @mthmulders?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] MartinKanters merged pull request #473: [MNG-6915] Adapt the logging width to the terminal width, including s…

Posted by GitBox <gi...@apache.org>.
MartinKanters merged pull request #473:
URL: https://github.com/apache/maven/pull/473


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven] MartinKanters commented on pull request #473: [MNG-6915] Adapt the logging width to the terminal width, including s…

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on pull request #473:
URL: https://github.com/apache/maven/pull/473#issuecomment-844814841


   > @MartinKanters it seems to work. I've forced pushed the change.
   
   Nice, I definitely prefer defaulting to the old width. I see that you are not targeting any customized ITs and removed the changes in the unit tests. To me that proves that it's backwards compatible for non-ansi terminals.
   And now that we have a constructor where we can put in the values, we can create some unit tests which verify that the terminal width is set correctly in all scenarios. I'm sorry that I'm asking for more changes on a PR that @mthmulders and I initially delivered... :)
    
   > Fwiw, there is a minor problem with the terminal width which can be improved later: ideally, we'd make the difference between the `System.out` and `System.err` streams. Currently, `MessageUtils.getTerminalWidth()` relies on `AnsiConsole.getTerminalWidth()` which first tries the get the width of the terminal using `System.out` and then try with `System.err`. The downside is that if the output is redirected using `mvn > out.txt` or even simply `mvn -l out.txt`, then the computed terminal width is not relevant. It's no big deal though. This also makes we wonder if the `MavenCli` should use `System.err` to print non standard output (i.e. version, help, etc...) instead of `System.out`...
   
   Right, that indeed sounds like something that can be dealt with later. About the last point we can also create a thread on the dev mailing list. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org