discord-jadx/app/src/main/java/lombok/core/debug/FileLog.java

56 lines
1.8 KiB
Java

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;
/* loaded from: com.discord-118107.apk:lombok/core/debug/FileLog.SCL.lombok */
public class FileLog {
private static FileOutputStream fos;
/* renamed from: lombok.core.debug.FileLog$1 reason: invalid class name */
/* loaded from: com.discord-118107.apk:lombok/core/debug/FileLog$1.SCL.lombok */
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;
}
}