2022-03-07 09:34:54 +00:00
|
|
|
package lombok.core.debug;
|
|
|
|
|
|
|
|
import com.adjust.sdk.Constants;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
import java.io.StringWriter;
|
2022-03-30 18:14:40 +00:00
|
|
|
/* loaded from: com.discord-121110.apk:lombok/core/debug/FileLog.SCL.lombok */
|
2022-03-07 09:34:54 +00:00
|
|
|
public class FileLog {
|
|
|
|
private static FileOutputStream fos;
|
|
|
|
|
|
|
|
/* renamed from: lombok.core.debug.FileLog$1 reason: invalid class name */
|
2022-03-30 18:14:40 +00:00
|
|
|
/* loaded from: com.discord-121110.apk:lombok/core/debug/FileLog$1.SCL.lombok */
|
2022-03-07 09:34:54 +00:00
|
|
|
class AnonymousClass1 extends Thread {
|
|
|
|
AnonymousClass1() {
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Thread, java.lang.Runnable
|
|
|
|
public void run() {
|
|
|
|
try {
|
|
|
|
FileLog.access$0().close();
|
|
|
|
} catch (Throwable unused) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void log(String str) {
|
|
|
|
log(str, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static synchronized void log(String str, Throwable th) {
|
|
|
|
try {
|
|
|
|
if (fos == null) {
|
|
|
|
fos = new FileOutputStream(new File(System.getProperty("user.home"), "LOMBOK-DEBUG-OUT.txt"));
|
|
|
|
Runtime.getRuntime().addShutdownHook(new AnonymousClass1());
|
|
|
|
}
|
|
|
|
fos.write(str.getBytes(Constants.ENCODING));
|
|
|
|
fos.write(10);
|
|
|
|
if (th != null) {
|
|
|
|
StringWriter stringWriter = new StringWriter();
|
|
|
|
th.printStackTrace(new PrintWriter(stringWriter));
|
|
|
|
fos.write(stringWriter.toString().getBytes(Constants.ENCODING));
|
|
|
|
fos.write(10);
|
|
|
|
}
|
|
|
|
fos.flush();
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new IllegalStateException("Internal lombok file-based debugging not possible", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static /* synthetic */ FileOutputStream access$0() {
|
|
|
|
return fos;
|
|
|
|
}
|
|
|
|
}
|