Skip to content

Commit

Permalink
iluwatar#2898 Reduced sout lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehspresso committed Apr 22, 2024
1 parent 08eded1 commit 43d2f79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.iluwatar.publishsubscribe;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.event.Level;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.Message;
Expand Down Expand Up @@ -50,7 +51,7 @@ public Borrower(String topicCFName, String topicName, double initialRate) {
subscriber.setMessageListener(this);

tConnection.start();
System.out.println("Initial rate is " + currentRate + " \nWaiting for new rates...");
LOGGER.info("Initial rate is " + currentRate + " \nWaiting for new rates...");
} catch(NamingException e) {
LOGGER.error(ERROR, e);
} catch(JMSException e) {
Expand All @@ -72,7 +73,7 @@ public void onMessage(Message message) {
} catch(JMSException e) {
LOGGER.error(ERROR, e);
}
System.out.println("Waiting for new rates...");
LOGGER.info("Waiting for new rates...");
}

public boolean close() {
Expand All @@ -95,9 +96,9 @@ public static void main(String[] args) {
topicName = args[1];
rate = Integer.parseInt(args[2]);
} else {
System.out.println("Invalid arguments. Should be: ");
System.out.println("java TBorrower [factory] [topic] [rate]");
System.exit(0);
LOGGER.info("Invalid arguments. Should be: ");
LOGGER.info("java TBorrower [factory] [topic] [rate]");
System.exit(1);
}

Borrower borrower = new Borrower(topicCF, topicName, rate);
Expand All @@ -106,8 +107,8 @@ public static void main(String[] args) {
// Run until enter is pressed
BufferedReader reader = new BufferedReader
(new InputStreamReader(System.in));
System.out.println ("TBorrower application started");
System.out.println ("Press enter to quit application");
LOGGER.info("TBorrower application started");
LOGGER.info("Press enter to quit application");
reader.readLine();
borrower.close();
System.exit(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static void main(String[] args) {
String line = reader.readLine();
//Exit if user pressed enter or line is blank
if (line == null || line.trim().length() == 0) {
System.out.println("Exiting...");
LOGGER.info("Exiting...");
lender.close();
System.exit(0);
}
Expand Down

0 comments on commit 43d2f79

Please sign in to comment.