-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBaseSkyflow.java
More file actions
38 lines (31 loc) · 1.11 KB
/
BaseSkyflow.java
File metadata and controls
38 lines (31 loc) · 1.11 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
package com.skyflow;
import com.skyflow.config.Credentials;
import com.skyflow.enums.LogLevel;
import com.skyflow.logs.InfoLogs;
import com.skyflow.utils.BaseUtils;
import com.skyflow.utils.logger.LogUtil;
class BaseSkyflow {
private final BaseSkyflowClientBuilder builder;
protected BaseSkyflow(BaseSkyflowClientBuilder builder) {
this.builder = builder;
}
public LogLevel getLogLevel() {
return this.builder.logLevel;
}
static class BaseSkyflowClientBuilder {
protected Credentials skyflowCredentials;
protected LogLevel logLevel;
protected BaseSkyflowClientBuilder() {
this.skyflowCredentials = null;
this.logLevel = LogLevel.ERROR;
}
public BaseSkyflowClientBuilder setLogLevel(LogLevel logLevel) {
this.logLevel = logLevel == null ? LogLevel.ERROR : logLevel;
LogUtil.setupLogger(this.logLevel);
LogUtil.printInfoLog(BaseUtils.parameterizedString(
InfoLogs.CURRENT_LOG_LEVEL.getLog(), String.valueOf(logLevel)
));
return this;
}
}
}