#502 Replaced usages of System.out with logger.
This commit is contained in:
@@ -22,6 +22,9 @@
|
||||
*/
|
||||
package com.iluwatar.lazy.loading;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Heavy objects are expensive to create.
|
||||
@@ -29,16 +32,18 @@ package com.iluwatar.lazy.loading;
|
||||
*/
|
||||
public class Heavy {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Heavy.class);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Heavy() {
|
||||
System.out.println("Creating Heavy ...");
|
||||
LOGGER.info("Creating Heavy ...");
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception caught.", e);
|
||||
}
|
||||
System.out.println("... Heavy created");
|
||||
LOGGER.info("... Heavy created");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user