mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-13 01:17:17 +01:00
143 lines
4.6 KiB
Java
143 lines
4.6 KiB
Java
package androidx.work;
|
|
|
|
import android.util.Log;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.core.os.ParcelCompat$$ExternalSyntheticOutline0;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
/* loaded from: classes14.dex */
|
|
public abstract class Logger {
|
|
private static final int MAX_PREFIXED_TAG_LENGTH = 20;
|
|
private static final int MAX_TAG_LENGTH = 23;
|
|
private static final String TAG_PREFIX = "WM-";
|
|
private static final Object sLock = new Object();
|
|
private static volatile Logger sLogger;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class LogcatLogger extends Logger {
|
|
private final int mLoggingLevel;
|
|
|
|
public LogcatLogger(int i) {
|
|
super(i);
|
|
this.mLoggingLevel = i;
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void error(@NonNull String str, @NonNull String str2) {
|
|
if (this.mLoggingLevel <= 6) {
|
|
Log.e(str, str2);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void info(@NonNull String str, @NonNull String str2) {
|
|
if (this.mLoggingLevel <= 4) {
|
|
Log.i(str, str2);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void warning(@NonNull String str, @NonNull String str2) {
|
|
if (this.mLoggingLevel <= 5) {
|
|
Log.w(str, str2);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void debug(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void verbose(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void error(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
|
|
if (this.mLoggingLevel <= 6) {
|
|
Log.e(str, str2, th);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void info(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
|
|
if (this.mLoggingLevel <= 4) {
|
|
Log.i(str, str2, th);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void warning(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
|
|
if (this.mLoggingLevel <= 5) {
|
|
Log.w(str, str2, th);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void debug(@NonNull String str, @NonNull String str2) {
|
|
}
|
|
|
|
@Override // androidx.work.Logger
|
|
public void verbose(@NonNull String str, @NonNull String str2) {
|
|
}
|
|
}
|
|
|
|
public Logger(int i) {
|
|
}
|
|
|
|
@NonNull
|
|
public static Logger get() {
|
|
Logger logger;
|
|
synchronized (sLock) {
|
|
try {
|
|
if (sLogger == null) {
|
|
sLogger = new LogcatLogger(3);
|
|
}
|
|
logger = sLogger;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
return logger;
|
|
}
|
|
|
|
public static void setLogger(@NonNull Logger logger) {
|
|
synchronized (sLock) {
|
|
sLogger = logger;
|
|
}
|
|
}
|
|
|
|
@NonNull
|
|
public static String tagWithPrefix(@NonNull String str) {
|
|
int length = str.length();
|
|
StringBuilder m = ParcelCompat$$ExternalSyntheticOutline0.m(23, TAG_PREFIX);
|
|
int i = MAX_PREFIXED_TAG_LENGTH;
|
|
if (length >= i) {
|
|
m.append(str.substring(0, i));
|
|
} else {
|
|
m.append(str);
|
|
}
|
|
return m.toString();
|
|
}
|
|
|
|
public abstract void debug(@NonNull String str, @NonNull String str2);
|
|
|
|
public abstract void debug(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
|
|
|
|
public abstract void error(@NonNull String str, @NonNull String str2);
|
|
|
|
public abstract void error(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
|
|
|
|
public abstract void info(@NonNull String str, @NonNull String str2);
|
|
|
|
public abstract void info(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
|
|
|
|
public abstract void verbose(@NonNull String str, @NonNull String str2);
|
|
|
|
public abstract void verbose(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
|
|
|
|
public abstract void warning(@NonNull String str, @NonNull String str2);
|
|
|
|
public abstract void warning(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
|
|
}
|