simplify logging with using varargs from slf4j 1.7

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1384389 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-09-13 15:54:45 +00:00
parent 94156c0805
commit ad315ae5b0
1 changed files with 18 additions and 24 deletions

View File

@ -22,6 +22,7 @@ package org.apache.archiva.webdav;
import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.AuditEvent;
import org.apache.archiva.audit.AuditListener; import org.apache.archiva.audit.AuditListener;
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
import org.apache.archiva.scheduler.ArchivaTaskScheduler; import org.apache.archiva.scheduler.ArchivaTaskScheduler;
import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler;
import org.apache.archiva.scheduler.repository.RepositoryTask; import org.apache.archiva.scheduler.repository.RepositoryTask;
@ -52,7 +53,6 @@ import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
import org.apache.jackrabbit.webdav.property.DavPropertySet; import org.apache.jackrabbit.webdav.property.DavPropertySet;
import org.apache.jackrabbit.webdav.property.DefaultDavProperty; import org.apache.jackrabbit.webdav.property.DefaultDavProperty;
import org.apache.jackrabbit.webdav.property.ResourceType; import org.apache.jackrabbit.webdav.property.ResourceType;
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat; import org.joda.time.format.ISODateTimeFormat;
@ -248,7 +248,7 @@ public class ArchivaDavResource
return null; return null;
} }
@SuppressWarnings( "unchecked" ) @SuppressWarnings ("unchecked")
public MultiStatusResponse alterProperties( List changeList ) public MultiStatusResponse alterProperties( List changeList )
throws DavException throws DavException
{ {
@ -316,12 +316,10 @@ public class ArchivaDavResource
} }
queueRepositoryTask( localFile ); queueRepositoryTask( localFile );
if ( log.isDebugEnabled() )
{ log.debug( "File '{}{}(current user '{}')", resource.getDisplayName(),
log.debug( ( exists ? "' modified " : "' created " ), this.principal );
"File '" + resource.getDisplayName() + ( exists ? "' modified " : "' created " ) + "(current user '"
+ this.principal + "')" );
}
triggerAuditEvent( resource, exists ? AuditEvent.MODIFY_FILE : AuditEvent.CREATE_FILE ); triggerAuditEvent( resource, exists ? AuditEvent.MODIFY_FILE : AuditEvent.CREATE_FILE );
} }
else if ( !inputContext.hasStream() && isCollection() ) // New directory else if ( !inputContext.hasStream() && isCollection() ) // New directory
@ -400,11 +398,10 @@ public class ArchivaDavResource
triggerAuditEvent( member, AuditEvent.REMOVE_FILE ); triggerAuditEvent( member, AuditEvent.REMOVE_FILE );
} }
if ( log.isDebugEnabled() )
{ log.debug( "{}{}' removed (current user '{}')", ( resource.isDirectory() ? "Directory '" : "File '" ),
log.debug( ( resource.isDirectory() ? "Directory '" : "File '" ) + member.getDisplayName() member.getDisplayName(), this.principal );
+ "' removed (current user '" + this.principal + "')" );
}
} }
catch ( IOException e ) catch ( IOException e )
{ {
@ -455,11 +452,10 @@ public class ArchivaDavResource
triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.MOVE_FILE ); triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.MOVE_FILE );
} }
if ( log.isDebugEnabled() )
{ log.debug( "{}{}' moved to '{}' (current user '{}')", ( isCollection() ? "Directory '" : "File '" ),
log.debug( ( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' moved to '" getLocalResource().getName(), destination, this.principal );
+ destination + "' (current user '" + this.principal + "')" );
}
} }
catch ( IOException e ) catch ( IOException e )
{ {
@ -495,12 +491,10 @@ public class ArchivaDavResource
triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.COPY_FILE ); triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.COPY_FILE );
} }
if ( log.isDebugEnabled() )
{ log.debug( "{}{}' copied to '{}' (current user '{)')", ( isCollection() ? "Directory '" : "File '" ),
log.debug( getLocalResource().getName(), destination, this.principal );
( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' copied to '"
+ destination + "' (current user '" + this.principal + "')" );
}
} }
catch ( IOException e ) catch ( IOException e )
{ {