Conversation
This is just an example how to expose logger levels (by logger name) to configure their levels.
michael-o
left a comment
There was a problem hiding this comment.
I pretty much like this idea, but I think it requires more thought and I will explain why: During Resolver work on sync context I have enabled TRACE of specific loggers only to get my result:
for buildId in $(eval echo {1..$BUILD_COUNT}); do \
$MAVEN_HOME/bin/mvn clean compile -T1C -B -DskipTests -Dmaven.repo.local=$LOCAL_REPO \
-Dorg.slf4j.simpleLogger.showThreadName=true -Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.log.org.eclipse.aether=trace -l $LOCK_FACTORY-$NAME_MAPPER-$buildId.log \
-Daether.connector.basic.threads=8 -Daether.metadataResolver.threads=8 \
-Daether.syncContext.named.time=60 \
-Daether.syncContext.named.factory=$LOCK_FACTORY -Daether.syncContext.named.nameMapper=$NAME_MAPPER; \
Would it make sense not to introduce -XL, but rather have a generic -L/--logger with the mandatory arg of {loggerName}:{level}/{loggerName}={level}?
| 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() ); |
There was a problem hiding this comment.
This sould be kebab case like other long options.
There was a problem hiding this comment.
The desc should be similar to one of ACTIVATE_PROFILES, structurally.
|
|
||
| if ( cliRequest.verbose ) | ||
| { | ||
| cliRequest.request.setLoggingLevel( MavenExecutionRequest.LOGGING_LEVEL_DEBUG ); |
There was a problem hiding this comment.
Do you know why any chance what this actually does? Since we cannot set it for the above?!
| } | ||
| } | ||
|
|
||
| if ( cliRequest.verbose ) |
There was a problem hiding this comment.
Should -X and -XL be mutually exclusive?
| break; | ||
| } | ||
| System.setProperty( "maven.logging.root.level", value ); | ||
| System.setProperty( "maven.logging." + loggerName + ".level", value ); |
There was a problem hiding this comment.
Interesting, I didn't even know that we have this. Why do we have it and why do we need it?
This is just an example how to expose logger levels (by logger name)
to configure their levels.