- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
79 lines
2.1 KiB
Java
79 lines
2.1 KiB
Java
package com.amazonaws.logging;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class LogFactory {
|
|
public static final String TAG = "LogFactory";
|
|
public static final Map logMap = new HashMap();
|
|
public static Level globalLogLevel = null;
|
|
|
|
public static Level getLevel() {
|
|
return globalLogLevel;
|
|
}
|
|
|
|
public static void setLevel(Level level) {
|
|
globalLogLevel = level;
|
|
}
|
|
|
|
public static synchronized Log getLog(Class cls) {
|
|
Log log;
|
|
synchronized (LogFactory.class) {
|
|
log = getLog(getTruncatedLogTag(cls.getSimpleName()));
|
|
}
|
|
return log;
|
|
}
|
|
|
|
public static synchronized Log getLog(String str) {
|
|
Log androidLog;
|
|
synchronized (LogFactory.class) {
|
|
try {
|
|
String truncatedLogTag = getTruncatedLogTag(str);
|
|
Map map = logMap;
|
|
Log log = (Log) map.get(truncatedLogTag);
|
|
if (log != null) {
|
|
return log;
|
|
}
|
|
if (Environment.isJUnitTest()) {
|
|
androidLog = new ConsoleLog(truncatedLogTag);
|
|
} else {
|
|
androidLog = new AndroidLog(truncatedLogTag);
|
|
}
|
|
map.put(truncatedLogTag, androidLog);
|
|
return androidLog;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static String getTruncatedLogTag(String str) {
|
|
if (str.length() <= 23) {
|
|
return str;
|
|
}
|
|
getLog(TAG).warn("Truncating log tag length as it exceed 23, the limit imposed by Android on certain API Levels");
|
|
return str.substring(0, 23);
|
|
}
|
|
|
|
public enum Level {
|
|
ALL(Integer.MIN_VALUE),
|
|
TRACE(0),
|
|
DEBUG(1),
|
|
INFO(2),
|
|
WARN(3),
|
|
ERROR(4),
|
|
OFF(Integer.MAX_VALUE);
|
|
|
|
private final int value;
|
|
|
|
public int getValue() {
|
|
return this.value;
|
|
}
|
|
|
|
Level(int i) {
|
|
this.value = i;
|
|
}
|
|
}
|
|
}
|