michael-o commented on a change in pull request #600:
URL: https://github.com/apache/maven/pull/600#discussion_r732165621
##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
##########
@@ -158,6 +160,7 @@ public CLIManager()
options.addOption( Option.builder( BUILDER ).longOpt( "builder"
).hasArg().desc( "The id of the build strategy to use" ).build() );
options.addOption( Option.builder( NO_TRANSFER_PROGRESS ).longOpt(
"no-transfer-progress" ).desc( "Do not display transfer progress when
downloading or uploading" ).build() );
options.addOption( Option.builder().longOpt( COLOR
).hasArg().optionalArg( true ).desc( "Defines the color mode of the output.
Supported are 'auto', 'always', 'never'." ).build() );
+ options.addOption( Option.builder( VERBOSE_LOGGERS ).longOpt(
"verboseLoggers" ).hasArg().desc( "Produce verbose output for loggers (comma
separated list of logger names)" ).build() );
Review comment:
This sould be kebab case like other long options.
##########
File path:
maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/Log4j2Configuration.java
##########
@@ -48,7 +54,7 @@ public void setRootLoggerLevel( Level level )
value = "error";
break;
}
- System.setProperty( "maven.logging.root.level", value );
+ System.setProperty( "maven.logging." + loggerName + ".level", value );
Review comment:
Interesting, I didn't even know that we have this. Why do we have it and
why do we need it?
##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
##########
@@ -511,6 +511,19 @@ void logging( CliRequest cliRequest )
slf4jLoggerFactory = LoggerFactory.getILoggerFactory();
Slf4jConfiguration slf4jConfiguration =
Slf4jConfigurationFactory.getConfiguration( slf4jLoggerFactory );
+ String[] verboseLoggers = null;
+ if ( cliRequest.commandLine.hasOption( CLIManager.VERBOSE_LOGGERS ) )
+ {
+ verboseLoggers = cliRequest.commandLine.getOptionValues(
CLIManager.VERBOSE_LOGGERS );
+ }
+ if ( verboseLoggers != null )
+ {
+ for ( String verboseLogger : verboseLoggers )
+ {
+ slf4jConfiguration.setLoggerLevel( verboseLogger,
Slf4jConfiguration.Level.DEBUG );
+ }
+ }
+
if ( cliRequest.verbose )
Review comment:
Should `-X` and `-XL` be mutually exclusive?
##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
##########
@@ -158,6 +160,7 @@ public CLIManager()
options.addOption( Option.builder( BUILDER ).longOpt( "builder"
).hasArg().desc( "The id of the build strategy to use" ).build() );
options.addOption( Option.builder( NO_TRANSFER_PROGRESS ).longOpt(
"no-transfer-progress" ).desc( "Do not display transfer progress when
downloading or uploading" ).build() );
options.addOption( Option.builder().longOpt( COLOR
).hasArg().optionalArg( true ).desc( "Defines the color mode of the output.
Supported are 'auto', 'always', 'never'." ).build() );
+ options.addOption( Option.builder( VERBOSE_LOGGERS ).longOpt(
"verboseLoggers" ).hasArg().desc( "Produce verbose output for loggers (comma
separated list of logger names)" ).build() );
Review comment:
The `desc` should be similar to one of `ACTIVATE_PROFILES`,
structurally.
##########
File path: maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
##########
@@ -511,6 +511,19 @@ void logging( CliRequest cliRequest )
slf4jLoggerFactory = LoggerFactory.getILoggerFactory();
Slf4jConfiguration slf4jConfiguration =
Slf4jConfigurationFactory.getConfiguration( slf4jLoggerFactory );
+ String[] verboseLoggers = null;
+ if ( cliRequest.commandLine.hasOption( CLIManager.VERBOSE_LOGGERS ) )
+ {
+ verboseLoggers = cliRequest.commandLine.getOptionValues(
CLIManager.VERBOSE_LOGGERS );
+ }
+ if ( verboseLoggers != null )
+ {
+ for ( String verboseLogger : verboseLoggers )
+ {
+ slf4jConfiguration.setLoggerLevel( verboseLogger,
Slf4jConfiguration.Level.DEBUG );
+ }
+ }
+
if ( cliRequest.verbose )
{
cliRequest.request.setLoggingLevel(
MavenExecutionRequest.LOGGING_LEVEL_DEBUG );
Review comment:
Do you know why any chance what this actually does? Since we cannot set
it for the above?!
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]