From: Olivier Lamy Date: Sat, 11 Jun 2011 17:55:52 +0000 (+0000) Subject: use slf4j feature to optimise debug X-Git-Tag: archiva-1.4-M1~669 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0ad81d8bc63ccc141787df32875afeb241092650;p=archiva.git use slf4j feature to optimise debug git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1134715 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml index 8275c40aa..7e2b2552a 100644 --- a/archiva-modules/archiva-base/archiva-proxy/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml @@ -48,6 +48,10 @@ commons-io commons-io + + com.google.guava + guava + commons-lang commons-lang diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java index c9e431bd7..9d9091159 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -19,6 +19,7 @@ package org.apache.maven.archiva.proxy; * under the License. */ +import com.google.common.collect.Lists; import org.apache.archiva.scheduler.ArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryTask; import org.apache.commons.collections.CollectionUtils; @@ -424,16 +425,16 @@ public class DefaultRepositoryProxyConnectors { if ( log.isDebugEnabled() ) { - log.debug( "Metadata " + logicalPath + " not found on remote repository \"" - + targetRepository.getRepository().getId() + "\".", e ); + log.debug( "Metadata {} not found on remote repository \"{}\".", + Lists.newArrayList( logicalPath, targetRepository.getRepository().getId() ), e ); } } catch ( NotModifiedException e ) { if ( log.isDebugEnabled() ) { - log.debug( "Metadata " + logicalPath + " not updated on remote repository \"" - + targetRepository.getRepository().getId() + "\".", e ); + log.debug( "Metadata {} not updated on remote repository \"{}\".", + Lists.newArrayList( logicalPath, targetRepository.getRepository().getId() ), e ); } } catch ( ProxyException e ) @@ -926,7 +927,7 @@ public class DefaultRepositoryProxyConnectors String defaultSetting = policy.getDefaultOption(); String setting = StringUtils.defaultString( settings.get( key ), defaultSetting ); - log.debug( "Applying [" + key + "] policy with [" + setting + "]" ); + log.debug( "Applying [{}] policy with [{}]", key, setting ); try { // all policies must approve the exception, any can cancel diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java index c84b2cd4c..99a490fbf 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java @@ -328,7 +328,7 @@ public class ArchivaDavResource { localFile.mkdir(); - log.debug( "Directory '" + resource.getDisplayName() + "' (current user '" + this.principal + "')" ); + log.debug( "Directory '{}' (current user '{}')", resource.getDisplayName(), this.principal ); triggerAuditEvent( resource, AuditEvent.CREATE_DIR ); } @@ -361,7 +361,7 @@ public class ArchivaDavResource { list.add( resource ); } - log.debug( "Resource '" + item + "' retrieved by '" + this.principal + "'" ); + log.debug( "Resource '{}' retrieved by '{}'", item, this.principal ); } } catch ( DavException e ) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java index 0884c649e..b0eeed5fd 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java @@ -217,7 +217,6 @@ public class ArchivaDavResourceFactory public void initialize() { - } public DavResource createResource( final DavResourceLocator locator, final DavServletRequest request, @@ -961,7 +960,7 @@ public class ArchivaDavResourceFactory if ( isAuthorized( request, repository ) ) { mergedRepositoryContents.add( resourceFile ); - log.debug( "Repository '" + repository + "' accessed by '" + activePrincipal + "'" ); + log.debug( "Repository '{}' accessed by '{}'", repository, activePrincipal ); } } catch ( DavException e ) @@ -982,7 +981,7 @@ public class ArchivaDavResourceFactory request.getMethod() ) ) ) { mergedRepositoryContents.add( resourceFile ); - log.debug( "Repository '" + repository + "' accessed by '" + activePrincipal + "'" ); + log.debug( "Repository '{}' accessed by '{}'", repository, activePrincipal ); } } catch ( UnauthorizedException e )