-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDstoreLogger.java
More file actions
34 lines (25 loc) · 852 Bytes
/
DstoreLogger.java
File metadata and controls
34 lines (25 loc) · 852 Bytes
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
import java.io.IOException;
public class DstoreLogger extends Logger {
private static final String LOG_FILE_SUFFIX = "dstore";
private static DstoreLogger instance = null;
private final String logFileSuffix;
public static void init(LoggingType loggingType, int port) throws IOException {
if (instance == null)
instance = new DstoreLogger(loggingType, port);
else
throw new IOException("DstoreLogger already initialised");
}
public static DstoreLogger getInstance() {
if (instance == null)
throw new RuntimeException("DstoreLogger has not been initialised yet");
return instance;
}
protected DstoreLogger(LoggingType loggingType, int port) throws IOException {
super(loggingType);
logFileSuffix = LOG_FILE_SUFFIX + "_" + port;
}
@Override
protected String getLogFileSuffix() {
return logFileSuffix;
}
}