#502 Replaced usages of System.out with logger.
This commit is contained in:
@ -22,12 +22,17 @@
|
||||
*/
|
||||
package com.iluwatar.semaphore;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A Customer attempts to repeatedly take Fruit from the FruitShop by
|
||||
* taking Fruit from FruitBowl instances.
|
||||
*/
|
||||
public class Customer extends Thread {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Customer.class);
|
||||
|
||||
/**
|
||||
* Name of the Customer.
|
||||
*/
|
||||
@ -63,13 +68,13 @@ public class Customer extends Thread {
|
||||
Fruit fruit;
|
||||
|
||||
if (bowl != null && (fruit = bowl.take()) != null) {
|
||||
System.out.println(name + " took an " + fruit);
|
||||
LOGGER.info("{} took an {}", name, fruit);
|
||||
fruitBowl.put(fruit);
|
||||
fruitShop.returnBowl(bowl);
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(name + " took " + fruitBowl);
|
||||
|
||||
LOGGER.info("{} took {}", name, fruitBowl);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user