165 lines
5.2 KiB
Java
165 lines
5.2 KiB
Java
package o;
|
|
|
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.PrintWriter;
|
|
import java.io.Serializable;
|
|
import java.io.StringWriter;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.security.AccessController;
|
|
import java.text.DateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Properties;
|
|
import org.apache.commons.logging.LogConfigurationException;
|
|
|
|
/* renamed from: o.gkx, reason: case insensitive filesystem */
|
|
/* loaded from: classes6.dex */
|
|
public class C15237gkx implements InterfaceC15219gkf, Serializable {
|
|
private static volatile String a = null;
|
|
private static DateFormat b = null;
|
|
private static Class c = null;
|
|
private static volatile boolean d = false;
|
|
private static Class e = null;
|
|
private static volatile boolean f = false;
|
|
private static volatile boolean h = false;
|
|
private static Properties i;
|
|
private volatile String g;
|
|
private volatile int j;
|
|
private volatile String k;
|
|
|
|
@Override // o.InterfaceC15219gkf
|
|
public final boolean e() {
|
|
return true;
|
|
}
|
|
|
|
static {
|
|
Properties properties = new Properties();
|
|
i = properties;
|
|
h = false;
|
|
f = true;
|
|
d = false;
|
|
a = "yyyy/MM/dd HH:mm:ss:SSS zzz";
|
|
b = null;
|
|
InputStream inputStream = (InputStream) AccessController.doPrivileged(new C15235gkv("simplelog.properties"));
|
|
if (inputStream != null) {
|
|
try {
|
|
properties.load(inputStream);
|
|
inputStream.close();
|
|
} catch (IOException unused) {
|
|
}
|
|
}
|
|
boolean z = h;
|
|
String c2 = c("org.apache.commons.logging.simplelog.showlogname");
|
|
if (c2 != null) {
|
|
z = "true".equalsIgnoreCase(c2);
|
|
}
|
|
h = z;
|
|
boolean z2 = f;
|
|
String c3 = c("org.apache.commons.logging.simplelog.showShortLogname");
|
|
if (c3 != null) {
|
|
z2 = "true".equalsIgnoreCase(c3);
|
|
}
|
|
f = z2;
|
|
boolean z3 = d;
|
|
String c4 = c("org.apache.commons.logging.simplelog.showdatetime");
|
|
if (c4 != null) {
|
|
z3 = "true".equalsIgnoreCase(c4);
|
|
}
|
|
d = z3;
|
|
if (z3) {
|
|
String str = a;
|
|
String c5 = c("org.apache.commons.logging.simplelog.dateTimeFormat");
|
|
if (c5 != null) {
|
|
str = c5;
|
|
}
|
|
a = str;
|
|
try {
|
|
b = new SimpleDateFormat(a);
|
|
} catch (IllegalArgumentException unused2) {
|
|
a = "yyyy/MM/dd HH:mm:ss:SSS zzz";
|
|
b = new SimpleDateFormat(a);
|
|
}
|
|
}
|
|
}
|
|
|
|
private static String c(String str) {
|
|
String str2;
|
|
try {
|
|
str2 = System.getProperty(str);
|
|
} catch (SecurityException unused) {
|
|
str2 = null;
|
|
}
|
|
return str2 == null ? i.getProperty(str) : str2;
|
|
}
|
|
|
|
private static /* synthetic */ Class b(String str) {
|
|
try {
|
|
return Class.forName(str);
|
|
} catch (ClassNotFoundException e2) {
|
|
throw new NoClassDefFoundError(e2.getMessage());
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static ClassLoader b() {
|
|
ClassLoader classLoader = null;
|
|
try {
|
|
Class cls = c;
|
|
if (cls == null) {
|
|
cls = b("java.lang.Thread");
|
|
c = cls;
|
|
}
|
|
try {
|
|
classLoader = (ClassLoader) cls.getMethod("getContextClassLoader", null).invoke(Thread.currentThread(), null);
|
|
} catch (InvocationTargetException e2) {
|
|
if (!(e2.getTargetException() instanceof SecurityException)) {
|
|
throw new LogConfigurationException("Unexpected InvocationTargetException", e2.getTargetException());
|
|
}
|
|
}
|
|
} catch (IllegalAccessException | NoSuchMethodException unused) {
|
|
}
|
|
if (classLoader != null) {
|
|
return classLoader;
|
|
}
|
|
Class cls2 = e;
|
|
if (cls2 == null) {
|
|
cls2 = b("o.gkx");
|
|
e = cls2;
|
|
}
|
|
return cls2.getClassLoader();
|
|
}
|
|
|
|
@Override // o.InterfaceC15219gkf
|
|
public final void d(Object obj, Throwable th) {
|
|
String format;
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
if (d) {
|
|
Date date = new Date();
|
|
synchronized (b) {
|
|
format = b.format(date);
|
|
}
|
|
stringBuffer.append(format);
|
|
stringBuffer.append(" ");
|
|
}
|
|
stringBuffer.append("[DEBUG] ");
|
|
if (f) {
|
|
throw null;
|
|
}
|
|
if (h) {
|
|
stringBuffer.append("null").append(" - ");
|
|
}
|
|
stringBuffer.append(String.valueOf(obj));
|
|
stringBuffer.append(" <");
|
|
stringBuffer.append(th.toString());
|
|
stringBuffer.append(UrlTreeKt.configurablePathSegmentSuffix);
|
|
StringWriter stringWriter = new StringWriter(1024);
|
|
PrintWriter printWriter = new PrintWriter(stringWriter);
|
|
th.printStackTrace(printWriter);
|
|
printWriter.close();
|
|
stringBuffer.append(stringWriter.toString());
|
|
System.err.println(stringBuffer.toString());
|
|
}
|
|
}
|