#502 Replaced usages of System.out with logger.
This commit is contained in:
@ -22,6 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.state;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Angry state.
|
||||
@ -29,6 +32,8 @@ package com.iluwatar.state;
|
||||
*/
|
||||
public class AngryState implements State {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AngryState.class);
|
||||
|
||||
private Mammoth mammoth;
|
||||
|
||||
public AngryState(Mammoth mammoth) {
|
||||
@ -37,12 +42,12 @@ public class AngryState implements State {
|
||||
|
||||
@Override
|
||||
public void observe() {
|
||||
System.out.println(String.format("%s is furious!", mammoth));
|
||||
LOGGER.info("{} is furious!", mammoth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnterState() {
|
||||
System.out.println(String.format("%s gets angry!", mammoth));
|
||||
LOGGER.info("{} gets angry!", mammoth);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,6 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.state;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Peaceful state.
|
||||
@ -29,6 +32,8 @@ package com.iluwatar.state;
|
||||
*/
|
||||
public class PeacefulState implements State {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PeacefulState.class);
|
||||
|
||||
private Mammoth mammoth;
|
||||
|
||||
public PeacefulState(Mammoth mammoth) {
|
||||
@ -37,12 +42,12 @@ public class PeacefulState implements State {
|
||||
|
||||
@Override
|
||||
public void observe() {
|
||||
System.out.println(String.format("%s is calm and peaceful.", mammoth));
|
||||
LOGGER.info("{} is calm and peaceful.", mammoth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnterState() {
|
||||
System.out.println(String.format("%s calms down.", mammoth));
|
||||
LOGGER.info("{} calms down.", mammoth);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user