#502 Replaced usages of System.out with logger.

This commit is contained in:
daniel-bryla
2016-10-23 19:59:03 +02:00
parent 4ca205c03c
commit 0438811489
154 changed files with 1155 additions and 792 deletions

View File

@ -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);
}