Files
rr3-apk/decompiled/sources/com/amazonaws/logging/LogFactory.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

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;
}
}
}