You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2017/03/07 19:55:10 UTC

svn commit: r1785876 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java

Author: pmouawad
Date: Tue Mar  7 19:55:10 2017
New Revision: 1785876

URL: http://svn.apache.org/viewvc?rev=1785876&view=rev
Log:
Improve logs

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java?rev=1785876&r1=1785875&r2=1785876&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java Tue Mar  7 19:55:10 2017
@@ -57,32 +57,34 @@ public class SamplerCreatorFactory {
             for (String strClassName : listClasses) {
                 try {
                     if(log.isDebugEnabled()) {
-                        log.debug("Loading class: "+ strClassName);
+                        log.debug("Loading class: {}", strClassName);
                     }
                     Class<?> commandClass = Class.forName(strClassName);
                     if (!Modifier.isAbstract(commandClass.getModifiers())) {
                         if(log.isDebugEnabled()) {
-                            log.debug("Instantiating: "+ commandClass.getName());
+                            log.debug("Instantiating: {}", commandClass.getName());
                         }
-                            SamplerCreator creator = (SamplerCreator) commandClass.newInstance();
-                            String[] contentTypes = creator.getManagedContentTypes();
-                            for (String contentType : contentTypes) {
-                                if(log.isDebugEnabled()) {
-                                    log.debug("Registering samplerCreator "+commandClass.getName()+" for content type:"+contentType);
-                                }
-                                SamplerCreator oldSamplerCreator = samplerCreatorMap.put(contentType, creator);
-                                if(oldSamplerCreator!=null) {
-                                    log.warn("A sampler creator was already registered for:"+contentType+", class:"+oldSamplerCreator.getClass()
-                                            + ", it will be replaced");
-                                }
-                            }                        
+                        SamplerCreator creator = (SamplerCreator) commandClass.newInstance();
+                        String[] contentTypes = creator.getManagedContentTypes();
+                        for (String contentType : contentTypes) {
+                            if(log.isDebugEnabled()) {
+                                log.debug("Registering samplerCreator {} for content type:{}", 
+                                        commandClass.getName(), contentType);
+                            }
+                            SamplerCreator oldSamplerCreator = samplerCreatorMap.put(contentType, creator);
+                            if(oldSamplerCreator!=null) {
+                                log.warn("A sampler creator was already registered for:{}, class:{}, it will be replaced", 
+                                        contentType, oldSamplerCreator.getClass());
+                            }
+                        }                        
                     }
                 } catch (Exception e) {
-                    log.error("Exception registering "+SamplerCreator.class.getName() + " with implementation:"+strClassName, e);
+                    log.error("Exception registering {} with implementation:{}",
+                            SamplerCreator.class.getName(),strClassName, e);
                 }
             }
         } catch (IOException e) {
-            log.error("Exception finding implementations of "+SamplerCreator.class, e);
+            log.error("Exception finding implementations of {}", SamplerCreator.class, e);
         }
     }