Skip to content

Commit

Permalink
Switch to SLF4J API for logger creation
Browse files Browse the repository at this point in the history
  • Loading branch information
aliesbelik committed Oct 29, 2021
1 parent dc48a26 commit cd0c224
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;

import org.apache.log.Logger;
import org.apache.jorphan.logging.LoggingManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.jmeter.samplers.Entry;
import org.apache.jmeter.samplers.SampleResult;
Expand All @@ -23,7 +23,7 @@ public class AMQPConsumer extends AMQPSampler implements Interruptible, TestStat

private static final long serialVersionUID = 7480863561320459091L;

private static final Logger log = LoggingManager.getLoggerForClass();
private static final Logger log = LoggerFactory.getLogger(AMQPConsumer.class);

private static final int DEFAULT_PREFETCH_COUNT = 0; // unlimited
public static final boolean DEFAULT_READ_RESPONSE = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import org.apache.commons.lang3.StringUtils;

import org.apache.log.Logger;
import org.apache.jorphan.logging.LoggingManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.samplers.Entry;
Expand All @@ -35,7 +35,7 @@ public class AMQPPublisher extends AMQPSampler implements Interruptible {

private static final long serialVersionUID = -8420658040465788497L;

private static final Logger log = LoggingManager.getLoggerForClass();
private static final Logger log = LoggerFactory.getLogger(AMQPPublisher.class);

//++ These are JMX names, and must not be changed
private final static String MESSAGE = "AMQPPublisher.Message";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import org.apache.commons.lang3.StringUtils;

import org.apache.log.Logger;
import org.apache.jorphan.logging.LoggingManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.jmeter.samplers.AbstractSampler;
import org.apache.jmeter.testelement.ThreadListener;
Expand All @@ -24,7 +24,7 @@

public abstract class AMQPSampler extends AbstractSampler implements ThreadListener {

private static final Logger log = LoggingManager.getLoggerForClass();
private static final Logger log = LoggerFactory.getLogger(AMQPSampler.class);

public static final String[] EXCHANGE_TYPES = new String[] {
"direct",
Expand Down Expand Up @@ -472,7 +472,7 @@ protected Channel createChannel() throws IOException, NoSuchAlgorithmException,
Channel channel = connection.createChannel();

if (!channel.isOpen()) {
log.fatalError("Failed to open channel: " + channel.getCloseReason().getLocalizedMessage());
log.error("Failed to open channel: " + channel.getCloseReason().getLocalizedMessage());
}

return channel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public class AMQPPublisherGui extends AMQPSamplerGui {

private static final long serialVersionUID = 1L;

private JPanel mainPanel;

//private static final String[] CONFIG_CHOICES = {"File", "Static"};
//private final JLabeledRadio configChoice = new JLabeledRadio("Message Source", CONFIG_CHOICES);
//private final FilePanel messageFile = new FilePanel("Filename", ALL_FILES);
Expand All @@ -35,10 +33,12 @@ public class AMQPPublisherGui extends AMQPSamplerGui {
private final JLabeledTextField contentType = new JLabeledTextField(" Content-Type");
private final JLabeledTextField contentEncoding = new JLabeledTextField("Content Encoding");

private JCheckBox persistent = new JCheckBox("Persistent", AMQPPublisher.DEFAULT_PERSISTENT);
private JCheckBox useTx = new JCheckBox("Use Transactions", AMQPPublisher.DEFAULT_USE_TX);
private final JCheckBox persistent = new JCheckBox("Persistent", AMQPPublisher.DEFAULT_PERSISTENT);
private final JCheckBox useTx = new JCheckBox("Use Transactions", AMQPPublisher.DEFAULT_USE_TX);

private final ArgumentsPanel headers = new ArgumentsPanel("Headers");

private ArgumentsPanel headers = new ArgumentsPanel("Headers");
private JPanel mainPanel;

public AMQPPublisherGui() {
init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.awt.*;
import javax.swing.*;

import org.apache.log.Logger;
import org.apache.jorphan.logging.LoggingManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
import org.apache.jmeter.testelement.TestElement;
Expand All @@ -18,7 +18,7 @@ public abstract class AMQPSamplerGui extends AbstractSamplerGui {

private static final long serialVersionUID = 1L;

private static final Logger log = LoggingManager.getLoggerForClass();
private static final Logger log = LoggerFactory.getLogger(AMQPSamplerGui.class);

private final JLabeledTextField exchange = new JLabeledTextField(" Exchange");
private final JLabeledChoice exchangeType = new JLabeledChoice(" Type ", AMQPSampler.EXCHANGE_TYPES, false, false);
Expand Down Expand Up @@ -82,7 +82,7 @@ public void configure(TestElement element) {

iterations.setText(sampler.getIterations());

//log.info("AMQPSamplerGui.configure() called");
log.debug("AMQPSamplerGui.configure() called");
}

/**
Expand Down Expand Up @@ -152,7 +152,8 @@ public void modifyTestElement(TestElement element) {

sampler.setIterations(iterations.getText());

//log.info("AMQPSamplerGui.modifyTestElement() called, set user/pass to " + username.getText() + "/" + password.getText() + " on sampler " + sampler);
log.debug("AMQPSamplerGui.modifyTestElement() called, set user/pass to "
+ username.getText() + "/" + password.getText() + " on sampler " + sampler);
}

protected void init() {
Expand Down

0 comments on commit cd0c224

Please sign in to comment.