Apply consistent log argument quoting for sigle- and multi-valued args

This commit is contained in:
Michael Osipov 2021-01-01 14:09:07 +01:00
parent a2d29b221d
commit 2201698234
7 changed files with 18 additions and 18 deletions

View File

@ -458,7 +458,7 @@ public class DefaultGraphBuilder
if ( projectsMap.containsKey( pluginKey ) ) if ( projectsMap.containsKey( pluginKey ) )
{ {
LOGGER.warn( "{} uses {} as extensions, which is not possible within the same reactor build. " LOGGER.warn( "'{}' uses '{}' as extension which is not possible within the same reactor build. "
+ "This plugin was pulled from the local repository!", project.getName(), plugin.getKey() ); + "This plugin was pulled from the local repository!", project.getName(), plugin.getKey() );
} }
} }

View File

@ -936,7 +936,7 @@ public class MavenProject
int index = attachedArtifacts.indexOf( artifact ); int index = attachedArtifacts.indexOf( artifact );
if ( index >= 0 ) if ( index >= 0 )
{ {
LOGGER.warn( "artifact {} already attached, replace previous instance", artifact ); LOGGER.warn( "artifact '{}' already attached, replacing previous instance", artifact );
attachedArtifacts.set( index, artifact ); attachedArtifacts.set( index, artifact );
} }
else else

View File

@ -74,7 +74,7 @@ public class DefaultProjectsSelector implements ProjectsSelector
if ( !result.getProblems().isEmpty() && LOGGER.isWarnEnabled() ) if ( !result.getProblems().isEmpty() && LOGGER.isWarnEnabled() )
{ {
LOGGER.warn( "" ); LOGGER.warn( "" );
LOGGER.warn( "Some problems were encountered while building the effective model for {}", LOGGER.warn( "Some problems were encountered while building the effective model for '{}'",
result.getProject().getId() ); result.getProject().getId() );
for ( ModelProblem problem : result.getProblems() ) for ( ModelProblem problem : result.getProblems() )

View File

@ -76,7 +76,7 @@ public class MultiModuleCollectionStrategy implements ProjectCollectionStrategy
} }
else else
{ {
logger.debug( "Multi module project collection failed: {}" logger.debug( "Multi module project collection failed:{}"
+ "Detected a POM file next to a .mvn folder in a parent directory ({}). " + "Detected a POM file next to a .mvn folder in a parent directory ({}). "
+ "Maven assumed that POM file to be the parent of the requested project ({}), but it turned " + "Maven assumed that POM file to be the parent of the requested project ({}), but it turned "
+ "out that it was not. Another project collection strategy will be executed as result.", + "out that it was not. Another project collection strategy will be executed as result.",
@ -91,7 +91,7 @@ public class MultiModuleCollectionStrategy implements ProjectCollectionStrategy
if ( fallThrough ) if ( fallThrough )
{ {
logger.debug( "Multi module project collection failed: {}" logger.debug( "Multi module project collection failed:{}"
+ "Detected that one of the modules of this multi module project uses another module as " + "Detected that one of the modules of this multi module project uses another module as "
+ "plugin extension which still needed to be built. This is not possible within the same " + "plugin extension which still needed to be built. This is not possible within the same "
+ "reactor build. Another project collection strategy will be executed as result.", + "reactor build. Another project collection strategy will be executed as result.",
@ -115,8 +115,8 @@ public class MultiModuleCollectionStrategy implements ProjectCollectionStrategy
if ( !multiModuleProjectPom.exists() ) if ( !multiModuleProjectPom.exists() )
{ {
logger.info( "Maven detected that the requested POM file is part of a multi module project, " logger.info( "Maven detected that the requested POM file is part of a multi module project, "
+ "but could not find a pom.xml file in the multi module root directory: '" + "but could not find a pom.xml file in the multi module root directory '{}'.",
+ request.getMultiModuleProjectDirectory() + "'. " ); request.getMultiModuleProjectDirectory() );
logger.info( "The reactor is limited to all projects under: " + request.getPom().getParent() ); logger.info( "The reactor is limited to all projects under: " + request.getPom().getParent() );
return request.getPom(); return request.getPom();
} }

View File

@ -790,7 +790,7 @@ public class MavenCli
} }
catch ( Exception e ) catch ( Exception e )
{ {
slf4jLogger.warn( "Failed to read extensions descriptor {}: {}", extensionsFile, e.getMessage() ); slf4jLogger.warn( "Failed to read extensions descriptor from '{}'", extensionsFile, e );
} }
return Collections.emptyList(); return Collections.emptyList();
} }
@ -818,11 +818,11 @@ public class MavenCli
extRealm.setParentRealm( coreRealm ); extRealm.setParentRealm( coreRealm );
slf4jLogger.debug( "Populating class realm {}", extRealm.getId() ); slf4jLogger.debug( "Populating class realm '{}'", extRealm.getId() );
for ( File file : extClassPath ) for ( File file : extClassPath )
{ {
slf4jLogger.debug( " Included {}", file ); slf4jLogger.debug( " included '{}'", file );
extRealm.addURL( file.toURI().toURL() ); extRealm.addURL( file.toURI().toURL() );
} }
@ -871,7 +871,7 @@ public class MavenCli
{ {
File file = resolveFile( new File( jar ), cliRequest.workingDirectory ); File file = resolveFile( new File( jar ), cliRequest.workingDirectory );
slf4jLogger.debug( " Included {}", file ); slf4jLogger.debug( " included '{}'", file );
jars.add( file ); jars.add( file );
} }
@ -1006,12 +1006,12 @@ public class MavenCli
if ( !cliRequest.showErrors ) if ( !cliRequest.showErrors )
{ {
slf4jLogger.error( "To see the full stack trace of the errors, re-run Maven with the {} switch.", slf4jLogger.error( "To see the full stack trace of the errors, re-run Maven with the '{}' switch.",
buffer().strong( "-e" ) ); buffer().strong( "-e" ) );
} }
if ( !slf4jLogger.isDebugEnabled() ) if ( !slf4jLogger.isDebugEnabled() )
{ {
slf4jLogger.error( "Re-run Maven using the {} switch to enable full debug logging.", slf4jLogger.error( "Re-run Maven using the '{}' switch to enable full debug logging.",
buffer().strong( "-X" ) ); buffer().strong( "-X" ) );
} }
@ -1299,9 +1299,9 @@ public class MavenCli
eventSpyDispatcher.onEvent( toolchainsRequest ); eventSpyDispatcher.onEvent( toolchainsRequest );
slf4jLogger.debug( "Reading global toolchains from {}", slf4jLogger.debug( "Reading global toolchains from '{}'",
getLocation( toolchainsRequest.getGlobalToolchainsSource(), globalToolchainsFile ) ); getLocation( toolchainsRequest.getGlobalToolchainsSource(), globalToolchainsFile ) );
slf4jLogger.debug( "Reading user toolchains from {}", slf4jLogger.debug( "Reading user toolchains from '{}'",
getLocation( toolchainsRequest.getUserToolchainsSource(), userToolchainsFile ) ); getLocation( toolchainsRequest.getUserToolchainsSource(), userToolchainsFile ) );
ToolchainsBuildingResult toolchainsResult = toolchainsBuilder.build( toolchainsRequest ); ToolchainsBuildingResult toolchainsResult = toolchainsBuilder.build( toolchainsRequest );

View File

@ -137,9 +137,9 @@ public class SettingsXmlConfigurationProcessor
request.getEventSpyDispatcher().onEvent( settingsRequest ); request.getEventSpyDispatcher().onEvent( settingsRequest );
} }
logger.debug( "Reading global settings from {}", logger.debug( "Reading global settings from '{}'",
getLocation( settingsRequest.getGlobalSettingsSource(), settingsRequest.getGlobalSettingsFile() ) ); getLocation( settingsRequest.getGlobalSettingsSource(), settingsRequest.getGlobalSettingsFile() ) );
logger.debug( "Reading user settings from {}", logger.debug( "Reading user settings from '{}'",
getLocation( settingsRequest.getUserSettingsSource(), settingsRequest.getUserSettingsFile() ) ); getLocation( settingsRequest.getUserSettingsSource(), settingsRequest.getUserSettingsFile() ) );
SettingsBuildingResult settingsResult = settingsBuilder.build( settingsRequest ); SettingsBuildingResult settingsResult = settingsBuilder.build( settingsRequest );

View File

@ -361,7 +361,7 @@ public class ExecutionEventLogger extends AbstractExecutionListener
{ {
if ( logger.isWarnEnabled() ) if ( logger.isWarnEnabled() )
{ {
logger.warn( "Goal {} requires online mode for execution but Maven is currently offline, skipping", logger.warn( "Goal '{}' requires online mode for execution but Maven is currently offline, skipping",
event.getMojoExecution().getGoal() ); event.getMojoExecution().getGoal() );
} }
} }