-
Notifications
You must be signed in to change notification settings - Fork 273
Expand file tree
/
Copy pathLogger.java
More file actions
69 lines (58 loc) · 2 KB
/
Copy pathLogger.java
File metadata and controls
69 lines (58 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package log;
import static log.ErrorCase.FUNCTION_INPUT_ERROR;
import java.util.List;
import java.util.Scanner;
public class Logger {
public static final String LEVEL_GUIDE = "\n## ";
public static final String LEVEL_ERROR = "\n[ERROR] ";
public static final String LEVEL_INFO = "\n[INFO] ";
public static void guidePrint(String errorBody) {
System.out.print(LEVEL_GUIDE + errorBody);
}
public static void errorPrint(String errorBody) {
System.out.println(LEVEL_ERROR + errorBody);
}
public static void infoPrint(String infoBody) {
System.out.print(LEVEL_INFO + infoBody);
}
public static void displayMainScreen() {
System.out.println("\n## 메인 화면\n"
+ "1. 역 관리\n"
+ "2. 노선 관리\n"
+ "3. 구간 관리\n"
+ "4. 지하철 노선도 출력\n"
+ "Q. 종료");
}
public static String displayInputScreen(Scanner scanner, List<String> whiteList) {
String input;
while (true) {
guidePrint("원하는 기능을 선택하세요.\n");
input = scanner.next();
if (whiteList.contains(input)) {
break;
}
errorPrint(FUNCTION_INPUT_ERROR);
}
return input;
}
public static void displayStationManageScreen() {
System.out.println("\n## 역 관리 화면\n"
+ "1. 역 등록\n"
+ "2. 역 삭제\n"
+ "3. 역 조회\n"
+ "B. 돌아가기");
}
public static void displayLineManageScreen() {
System.out.println("\n## 노선 관리 화면\n"
+ "1. 노선 등록\n"
+ "2. 노선 삭제\n"
+ "3. 노선 조회\n"
+ "B. 돌아가기");
}
public static void displaySectionManageScreen() {
System.out.println("\n## 구간 관리 화면\n"
+ "1. 구간 등록\n"
+ "2. 구간 삭제\n"
+ "B. 돌아가기");
}
}