#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,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);
}
}

View File

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