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/14 14:04:53 UTC

[GitHub] [maven] mthmulders commented on a change in pull request #472: [MNG-6915] Adapt the logging width to the terminal width, including sensible limits.

mthmulders commented on a change in pull request #472:
URL: https://github.com/apache/maven/pull/472#discussion_r632551481



##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
##########
@@ -53,9 +54,15 @@
 {
     private final Logger logger;
 
-    private static final int LINE_LENGTH = 72;
+    private static final int MAX_LOG_PREFIX_SIZE = 8; // "[ERROR] "
+    private static final int PROJECT_STATUS_SUFFIX_SIZE = 20; // "SUCCESS [  0.000 s]"
+    private static final int MIN_TERMINAL_WIDTH = 60;
+    private static final int MAX_TERMINAL_WIDTH = 130;
+    private static final int TERMINAL_WIDTH =
+            Math.min( MAX_TERMINAL_WIDTH, Math.max( MessageUtils.getTerminalWidth(), MIN_TERMINAL_WIDTH ) );

Review comment:
       If we understand correctly, this would make sure that if a terminal gets resized _during_ a Maven build, the output width would be recomputed accordingly?
   If that is the case, we don't understand how storing this value in a `MavenSession` instance rather than a constant would solve this. As far as we know, the `MavenSession` lifetime roughly matches the lifetime of the JVM process, and as such, of the classloader.




-- 
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