diff options
author | Joakim Erdfelt <joakime@apache.org> | 2008-02-21 07:31:33 +0000 |
---|---|---|
committer | Joakim Erdfelt <joakime@apache.org> | 2008-02-21 07:31:33 +0000 |
commit | 5f27f502ff339508a20b16f4f3822cbee07eb5ba (patch) | |
tree | fe2d5724bd1df2122e1114880da0df0ceb3b6ac4 /archiva-base/archiva-configuration | |
parent | 45fca34ec2639fe060df1bc459b858811b598ec5 (diff) | |
download | archiva-5f27f502ff339508a20b16f4f3822cbee07eb5ba.tar.gz archiva-5f27f502ff339508a20b16f4f3822cbee07eb5ba.zip |
MRM-708 - Migrate from Plexus Logging to Slf4J
* Finishing up AbstractLogEnabled conversions to Slf4J.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@629704 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-base/archiva-configuration')
2 files changed, 24 insertions, 19 deletions
diff --git a/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java index 4ca6f0229..987a456d7 100644 --- a/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java +++ b/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java @@ -36,12 +36,13 @@ import org.codehaus.plexus.evaluator.DefaultExpressionEvaluator; import org.codehaus.plexus.evaluator.EvaluatorException; import org.codehaus.plexus.evaluator.ExpressionEvaluator; import org.codehaus.plexus.evaluator.sources.SystemPropertyExpressionSource; -import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; import org.codehaus.plexus.registry.Registry; import org.codehaus.plexus.registry.RegistryException; import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.io.IOException; @@ -83,9 +84,10 @@ import java.util.Map.Entry; * @plexus.component role="org.apache.maven.archiva.configuration.ArchivaConfiguration" */ public class DefaultArchivaConfiguration - extends AbstractLogEnabled implements ArchivaConfiguration, RegistryListener, Initializable { + private Logger log = LoggerFactory.getLogger(DefaultArchivaConfiguration.class); + /** * Plexus registry to read the configuration from. * @@ -287,7 +289,7 @@ public class DefaultArchivaConfiguration else { // Policy key doesn't exist. Don't add it to golden version. - getLogger().warn( "Policy [" + policyId + "] does not exist." ); + log.warn( "Policy [" + policyId + "] does not exist." ); } } @@ -323,13 +325,13 @@ public class DefaultArchivaConfiguration { if ( MapUtils.isEmpty( prePolicies ) ) { - getLogger().error( "No PreDownloadPolicies found!" ); + log.error( "No PreDownloadPolicies found!" ); return null; } if ( MapUtils.isEmpty( postPolicies ) ) { - getLogger().error( "No PostDownloadPolicies found!" ); + log.error( "No PostDownloadPolicies found!" ); return null; } @@ -354,13 +356,13 @@ public class DefaultArchivaConfiguration { if ( MapUtils.isEmpty( prePolicies ) ) { - getLogger().error( "No PreDownloadPolicies found!" ); + log.error( "No PreDownloadPolicies found!" ); return false; } if ( MapUtils.isEmpty( postPolicies ) ) { - getLogger().error( "No PostDownloadPolicies found!" ); + log.error( "No PostDownloadPolicies found!" ); return false; } @@ -505,7 +507,7 @@ public class DefaultArchivaConfiguration } catch ( IOException e ) { - getLogger().error( "Unable to create " + filetype + " file: " + e.getMessage(), e ); + log.error( "Unable to create " + filetype + " file: " + e.getMessage(), e ); return false; } } @@ -521,7 +523,7 @@ public class DefaultArchivaConfiguration } catch ( Throwable t ) { - getLogger().warn( "Unable to notify of saved configuration event.", t ); + log.warn( "Unable to notify of saved configuration event.", t ); } } } diff --git a/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java b/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java index c286eac50..486e8f495 100644 --- a/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java +++ b/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java @@ -19,23 +19,25 @@ package org.apache.maven.archiva.configuration; * under the License. */ +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; import org.apache.commons.configuration.CombinedConfiguration; +import org.apache.maven.archiva.common.utils.Slf4JPlexusLogger; import org.apache.maven.archiva.configuration.functors.FiletypeSelectionPredicate; import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryReader; -import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; import org.codehaus.plexus.registry.RegistryException; import org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry; - -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * FileTypes @@ -46,9 +48,10 @@ import java.util.Map; * @plexus.component role="org.apache.maven.archiva.configuration.FileTypes" */ public class FileTypes - extends AbstractLogEnabled implements Initializable { + private Logger log = LoggerFactory.getLogger(FileTypes.class); + public static final String ARTIFACTS = "artifacts"; public static final String AUTO_REMOVE = "auto-remove"; @@ -122,7 +125,7 @@ public class FileTypes Field fld = commonsRegistry.getClass().getDeclaredField( "configuration" ); fld.setAccessible( true ); fld.set( commonsRegistry, new CombinedConfiguration() ); - commonsRegistry.enableLogging( getLogger() ); + commonsRegistry.enableLogging( new Slf4JPlexusLogger( FileTypes.class ) ); commonsRegistry.addConfigurationFromResource( "org/apache/maven/archiva/configuration/default-archiva.xml" ); // Read configuration as it was intended. |