mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-08-02 16:10:09 +07:00
Loading now loads existing contexts as well
Loading now loads contexts created before manager created Added additional trace logging
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package com.riiablo;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.collections4.Trie;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
@ -107,21 +109,35 @@ public class GdxLoggerManager {
|
||||
}
|
||||
|
||||
public void saveAll() {
|
||||
log.trace("Saving contexts...");
|
||||
for (String context : logs.getContexts().keySet()) {
|
||||
try {
|
||||
save(context);
|
||||
} catch (Throwable t) {
|
||||
log.warn("Failed to save {}", context, t);
|
||||
log.warn("Failed to save {}", getDebugName(context), t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadAll() {
|
||||
log.trace("Loading existing contexts...");
|
||||
Set<String> loaded = new HashSet<>();
|
||||
for (String context : logs.getContexts().keySet()) {
|
||||
try {
|
||||
load(context);
|
||||
loaded.add(context);
|
||||
} catch (Throwable t) {
|
||||
log.warn("Failed to load {}", getDebugName(context), t);
|
||||
}
|
||||
}
|
||||
|
||||
log.trace("Loading preferences...");
|
||||
for (String context : PREFERENCES.get().keySet()) {
|
||||
if (loaded.contains(context)) continue;
|
||||
try {
|
||||
load(context);
|
||||
} catch (Throwable t) {
|
||||
log.warn("Failed to load {}", context, t);
|
||||
log.warn("Failed to load {}", getDebugName(context), t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user