#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

@ -23,6 +23,9 @@
package com.iluwatar.mute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.sql.SQLException;
@ -46,6 +49,8 @@ import java.sql.SQLException;
*/
public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
/**
* Program entry point.
*
@ -88,7 +93,7 @@ public class App {
}
private static void utilizeResource(Resource resource) throws SQLException {
System.out.println("Utilizing acquired resource: " + resource);
LOGGER.info("Utilizing acquired resource: {}", resource);
}
private static Resource acquireResource() throws SQLException {

View File

@ -32,9 +32,13 @@ import java.io.PrintStream;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MuteTest {
private static final Logger LOGGER = LoggerFactory.getLogger(MuteTest.class);
private static final String MESSAGE = "should not occur";
@Rule public ExpectedException exception = ExpectedException.none();
@ -69,7 +73,7 @@ public class MuteTest {
private void methodNotThrowingAnyException() {
System.out.println("Executed successfully");
LOGGER.info("Executed successfully");
}
private void methodThrowingException() throws Exception {