SharedPreference関係の機能を削除

This commit is contained in:
rca 2024-07-06 10:38:07 +09:00
parent c25e9837f8
commit ee5861ad2c
2 changed files with 1 additions and 16 deletions

View File

@ -6,7 +6,6 @@ import one.nem.kidshift.utils.models.LogModel;
public interface KSLogger {
KSLogger addTag(String tag);
List<LogModel> getHistory();
void info(String message);
void warn(String message);
void error(String message);

View File

@ -21,12 +21,8 @@ import one.nem.kidshift.utils.models.LogModel;
public class KSLoggerImpl implements KSLogger {
private ArrayList<String> tags = new ArrayList<String>();
private SharedPrefUtils sharedPrefUtils;
@AssistedInject
public KSLoggerImpl(SharedPrefUtilsFactory sharedPrefUtilsFactory, @Assisted String name) {
sharedPrefUtils = sharedPrefUtilsFactory.create("KSLogger");
public KSLoggerImpl(@Assisted String name) {
tags.clear();
tags.add(name);
}
@ -37,11 +33,6 @@ public class KSLoggerImpl implements KSLogger {
return this;
}
@Override
public List<LogModel> getHistory() {
return sharedPrefUtils.getObjects(LogModel.class);
}
@Override
public void info(String message) {
log(new LogModel(LogLevelEnum.INFO, tags.toArray(new String[0]), message));
@ -73,14 +64,9 @@ public class KSLoggerImpl implements KSLogger {
}
private void log(LogModel log) {
addLog(log);
outputLog(log);
}
private void addLog(LogModel log) {
sharedPrefUtils.saveObject(log);
}
private void outputLog(LogModel log) {
// ,区切りで出力
String tags = log.getTags().length > 0 ? String.join(",", log.getTags()) : "UNTAGGED";