File tree 3 files changed +8
-8
lines changed
module/src/main/java/com/iluwatar/module
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,8 @@ public final class App {
45
45
public static void prepare () throws FileNotFoundException {
46
46
47
47
/* Create new singleton objects and prepare their modules */
48
- fileLoggerModule = FileLoggerModule .getSingleton ();
49
- consoleLoggerModule = ConsoleLoggerModule .getSingleton ();
50
-
51
- /* Prepare modules */
52
- fileLoggerModule .prepare ();
53
- consoleLoggerModule .prepare ();
48
+ fileLoggerModule = FileLoggerModule .getSingleton ().prepare ();
49
+ consoleLoggerModule = ConsoleLoggerModule .getSingleton ().prepare ();
54
50
}
55
51
56
52
/**
Original file line number Diff line number Diff line change @@ -56,12 +56,14 @@ public static ConsoleLoggerModule getSingleton() {
56
56
/**
57
57
* Following method performs the initialization
58
58
*/
59
- public void prepare () {
59
+ public ConsoleLoggerModule prepare () {
60
60
61
61
LOGGER .debug ("ConsoleLoggerModule::prepare();" );
62
62
63
63
this .output = new PrintStream (System .out );
64
64
this .error = new PrintStream (System .err );
65
+
66
+ return this ;
65
67
}
66
68
67
69
/**
Original file line number Diff line number Diff line change @@ -64,12 +64,14 @@ public static FileLoggerModule getSingleton() {
64
64
* @throws FileNotFoundException if program is not able to find log files (output.txt and
65
65
* error.txt)
66
66
*/
67
- public void prepare () throws FileNotFoundException {
67
+ public FileLoggerModule prepare () throws FileNotFoundException {
68
68
69
69
LOGGER .debug ("FileLoggerModule::prepare();" );
70
70
71
71
this .output = new PrintStream (new FileOutputStream (OUTPUT_FILE ));
72
72
this .error = new PrintStream (new FileOutputStream (ERROR_FILE ));
73
+
74
+ return this ;
73
75
}
74
76
75
77
/**
You can’t perform that action at this time.
0 commit comments