#502 Replaced usages of System.out with logger.
This commit is contained in:
@ -22,6 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.adapter;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Adapter class. Adapts the interface of the device ({@link FishingBoat}) into {@link BattleShip}
|
||||
@ -33,6 +36,8 @@ package com.iluwatar.adapter;
|
||||
*/
|
||||
public class BattleFishingBoat implements BattleShip {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BattleFishingBoat.class);
|
||||
|
||||
private FishingBoat boat;
|
||||
|
||||
public BattleFishingBoat() {
|
||||
@ -41,7 +46,7 @@ public class BattleFishingBoat implements BattleShip {
|
||||
|
||||
@Override
|
||||
public void fire() {
|
||||
System.out.println("fire!");
|
||||
LOGGER.info("fire!");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,6 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.adapter;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Device class (adaptee in the pattern). We want to reuse this class
|
||||
@ -29,12 +32,14 @@ package com.iluwatar.adapter;
|
||||
*/
|
||||
public class FishingBoat {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FishingBoat.class);
|
||||
|
||||
public void sail() {
|
||||
System.out.println("The Boat is moving to that place");
|
||||
LOGGER.info("The Boat is moving to that place");
|
||||
}
|
||||
|
||||
public void fish() {
|
||||
System.out.println("fishing ...");
|
||||
LOGGER.info("fishing ...");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user