mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 12:59:13 +00:00
#502 Replaced usages of System.out with logger.
This commit is contained in:
@@ -22,6 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.templatemethod;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* StealingMethod defines skeleton for the algorithm.
|
||||
@@ -29,6 +32,8 @@ package com.iluwatar.templatemethod;
|
||||
*/
|
||||
public abstract class StealingMethod {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(StealingMethod.class);
|
||||
|
||||
protected abstract String pickTarget();
|
||||
|
||||
protected abstract void confuseTarget(String target);
|
||||
@@ -40,7 +45,7 @@ public abstract class StealingMethod {
|
||||
*/
|
||||
public void steal() {
|
||||
String target = pickTarget();
|
||||
System.out.println("The target has been chosen as " + target + ".");
|
||||
LOGGER.info("The target has been chosen as {}.", target);
|
||||
confuseTarget(target);
|
||||
stealTheItem(target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user