#502 Replaced usages of System.out with logger.
This commit is contained in:
@ -22,6 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.halfsynchalfasync;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
/**
|
||||
@ -66,6 +69,8 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
*/
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
|
||||
/**
|
||||
* Program entry point
|
||||
*
|
||||
@ -128,7 +133,7 @@ public class App {
|
||||
@Override
|
||||
public void onPostCall(Long result) {
|
||||
// Handle the result of computation
|
||||
System.out.println(result);
|
||||
LOGGER.info(result.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,7 +146,7 @@ public class App {
|
||||
try {
|
||||
Thread.sleep(i);
|
||||
} catch (InterruptedException e) {
|
||||
System.out.println(e);
|
||||
LOGGER.error("Exception caught.", e);
|
||||
}
|
||||
return i * (i + 1) / 2;
|
||||
}
|
||||
|
Reference in New Issue
Block a user