package c.o.a; import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; /* compiled from: CameraLogger */ public final class b { public static int a = 3; public static Set b; @VisibleForTesting /* renamed from: c reason: collision with root package name */ public static AbstractC0156b f1471c; @NonNull public String d; /* compiled from: CameraLogger */ public static class a implements AbstractC0156b { @Override // c.o.a.b.AbstractC0156b public void a(int i, @NonNull String str, @NonNull String str2, @Nullable Throwable th) { if (i == 0) { Log.v(str, str2, th); } else if (i == 1) { Log.i(str, str2, th); } else if (i == 2) { Log.w(str, str2, th); } else if (i == 3) { Log.e(str, str2, th); } } } /* compiled from: CameraLogger */ /* renamed from: c.o.a.b$b reason: collision with other inner class name */ public interface AbstractC0156b { void a(int i, @NonNull String str, @NonNull String str2, @Nullable Throwable th); } static { CopyOnWriteArraySet copyOnWriteArraySet = new CopyOnWriteArraySet(); b = copyOnWriteArraySet; a aVar = new a(); f1471c = aVar; copyOnWriteArraySet.add(aVar); } public b(@NonNull String str) { this.d = str; } @Nullable public final String a(int i, @NonNull Object... objArr) { Throwable th = null; if (!(a <= i && b.size() > 0)) { return null; } StringBuilder sb = new StringBuilder(); for (Object obj : objArr) { if (obj instanceof Throwable) { th = (Throwable) obj; } sb.append(String.valueOf(obj)); sb.append(" "); } String trim = sb.toString().trim(); for (AbstractC0156b bVar : b) { bVar.a(i, this.d, trim, th); } return trim; } }