Review comments++

This commit is contained in:
Amit Dixit 2016-12-01 16:29:35 +05:30
parent f67d2fd9a9
commit 5d8806858b
3 changed files with 8 additions and 8 deletions

View File

@ -45,12 +45,8 @@ public final class App {
public static void prepare() throws FileNotFoundException {
/* Create new singleton objects and prepare their modules */
fileLoggerModule = FileLoggerModule.getSingleton();
consoleLoggerModule = ConsoleLoggerModule.getSingleton();
/* Prepare modules */
fileLoggerModule.prepare();
consoleLoggerModule.prepare();
fileLoggerModule = FileLoggerModule.getSingleton().prepare();
consoleLoggerModule = ConsoleLoggerModule.getSingleton().prepare();
}
/**

View File

@ -56,12 +56,14 @@ public final class ConsoleLoggerModule {
/**
* Following method performs the initialization
*/
public void prepare() {
public ConsoleLoggerModule prepare() {
LOGGER.debug("ConsoleLoggerModule::prepare();");
this.output = new PrintStream(System.out);
this.error = new PrintStream(System.err);
return this;
}
/**

View File

@ -64,12 +64,14 @@ public final class FileLoggerModule {
* @throws FileNotFoundException if program is not able to find log files (output.txt and
* error.txt)
*/
public void prepare() throws FileNotFoundException {
public FileLoggerModule prepare() throws FileNotFoundException {
LOGGER.debug("FileLoggerModule::prepare();");
this.output = new PrintStream(new FileOutputStream(OUTPUT_FILE));
this.error = new PrintStream(new FileOutputStream(ERROR_FILE));
return this;
}
/**