package com.chartboost.sdk.impl;

import android.util.Log;
import com.chartboost.sdk.LoggingLevel;
import kotlin.enums.EnumEntries;
import kotlin.enums.EnumEntriesKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
/* loaded from: classes2.dex */
public final class c7 {

    /* renamed from: a  reason: collision with root package name */
    public static final c7 f1668a = new c7();
    public static LoggingLevel b = LoggingLevel.INTEGRATION;

    /* loaded from: classes2.dex */
    public /* synthetic */ class b {

        /* renamed from: a  reason: collision with root package name */
        public static final /* synthetic */ int[] f1669a;

        static {
            int[] iArr = new int[a.values().length];
            try {
                iArr[a.b.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[a.c.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                iArr[a.d.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr[a.e.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr[a.f.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                iArr[a.g.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            f1669a = iArr;
        }
    }

    public static final void a(String msg, Throwable th) {
        Intrinsics.checkNotNullParameter(msg, "msg");
        f1668a.a(a.b, msg, th);
    }

    public static final void b(String msg, Throwable th) {
        Intrinsics.checkNotNullParameter(msg, "msg");
        f1668a.a(a.c, msg, th);
    }

    public static final void c(String msg, Throwable th) {
        Intrinsics.checkNotNullParameter(msg, "msg");
        f1668a.a(a.e, msg, th);
    }

    public static final void d(String msg, Throwable th) {
        Intrinsics.checkNotNullParameter(msg, "msg");
        f1668a.a(a.f, msg, th);
    }

    public static final void e(String msg, Throwable th) {
        Intrinsics.checkNotNullParameter(msg, "msg");
        f1668a.a(a.d, msg, th);
    }

    /* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
    /* JADX WARN: Unknown enum class pattern. Please report as an issue! */
    /* loaded from: classes2.dex */
    public static final class a {
        public static final a b = new a("DEBUG", 0);
        public static final a c = new a("ERROR", 1);
        public static final a d = new a("WARNING", 2);
        public static final a e = new a("INFO", 3);
        public static final a f = new a("VERBOSE", 4);
        public static final a g = new a("WTF", 5);
        public static final /* synthetic */ a[] h;
        public static final /* synthetic */ EnumEntries i;

        static {
            a[] a2 = a();
            h = a2;
            i = EnumEntriesKt.enumEntries(a2);
        }

        public static final /* synthetic */ a[] a() {
            return new a[]{b, c, d, e, f, g};
        }

        public static a valueOf(String str) {
            return (a) Enum.valueOf(a.class, str);
        }

        public static a[] values() {
            return (a[]) h.clone();
        }

        public a(String str, int i2) {
        }
    }

    public static /* synthetic */ void a(String str, Throwable th, int i, Object obj) {
        if ((i & 2) != 0) {
            th = null;
        }
        a(str, th);
    }

    public static /* synthetic */ void b(String str, Throwable th, int i, Object obj) {
        if ((i & 2) != 0) {
            th = null;
        }
        b(str, th);
    }

    public final StackTraceElement b(int i) {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        if (stackTrace.length > i) {
            return stackTrace[i];
        }
        return null;
    }

    public static /* synthetic */ void c(String str, Throwable th, int i, Object obj) {
        if ((i & 2) != 0) {
            th = null;
        }
        c(str, th);
    }

    public static /* synthetic */ void d(String str, Throwable th, int i, Object obj) {
        if ((i & 2) != 0) {
            th = null;
        }
        e(str, th);
    }

    public final String a(int i) {
        StackTraceElement b2 = b(i);
        if (b2 != null) {
            String className = b2.getClassName();
            Intrinsics.checkNotNullExpressionValue(className, "getClassName(...)");
            String str = StringsKt.substringAfterLast$default(className, (char) com.amazon.a.a.o.c.a.b.f117a, (String) null, 2, (Object) null) + "." + b2.getMethodName() + "():";
            if (str != null) {
                return str;
            }
        }
        return "";
    }

    public static /* synthetic */ String a(c7 c7Var, int i, int i2, Object obj) {
        if ((i2 & 1) != 0) {
            i = 8;
        }
        return c7Var.a(i);
    }

    public final void a(a aVar, String str, Throwable th) {
        if (b == LoggingLevel.ALL || b == LoggingLevel.INTEGRATION) {
            String str2 = a(this, 0, 1, (Object) null) + " " + str;
            switch (b.f1669a[aVar.ordinal()]) {
                case 1:
                    Log.d("[ChartboostMonetization]", str2, th);
                    return;
                case 2:
                    Log.e("[ChartboostMonetization]", str2, th);
                    return;
                case 3:
                    Log.w("[ChartboostMonetization]", str2, th);
                    return;
                case 4:
                    Log.i("[ChartboostMonetization]", str2, th);
                    return;
                case 5:
                    Log.v("[ChartboostMonetization]", str2, th);
                    return;
                case 6:
                    Log.wtf("[ChartboostMonetization]", str2, th);
                    return;
                default:
                    return;
            }
        }
    }
}
