]> source.dussan.org Git - archiva.git/commitdiff
use slf4j feature to optimise debug
authorOlivier Lamy <olamy@apache.org>
Sat, 11 Jun 2011 17:55:52 +0000 (17:55 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 11 Jun 2011 17:55:52 +0000 (17:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1134715 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-proxy/pom.xml
archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java

index 8275c40aa5d1f6a4c441eb919507d20e0248f063..7e2b2552ab80637256196512bfb45dd202a208d6 100644 (file)
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
     </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+    </dependency>
     <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
index c9e431bd777c9e4f10afe2bf5fc28282beb6babf..9d9091159bad12bb4589a52e0ec2b00dd266921b 100644 (file)
@@ -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.<Object>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.<Object>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
index c84b2cd4c1fd81107dacefedb670066c2cd0bdb2..99a490fbff8735a83b393c2a9f241e4588dee370 100644 (file)
@@ -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 )
index 0884c649e558f895a4fc6b2e6a95acd2d0b9cd5e..b0eeed5fd9f59ce4ed027664f7468d38287ad48b 100644 (file)
@@ -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 )