package a.c.b.a0;

import android.util.Log;

public class a implements c {
    private static final String h = "UCarProtocol";
    private int f = 4;
    private boolean g = false;

    @Override // a.c.b.a0.c
    public void a(int i) {
        if (i > 6) {
            this.f = 6;
        }
        if (i < 2) {
            this.f = 2;
        }
        this.f = i;
    }

    @Override // a.c.b.a0.c
    public void a(String str, String str2) {
        if (this.f <= 4) {
            Log.i(h, str + "(" + Thread.currentThread().getName() + "): " + str2);
        }
    }

    @Override // a.c.b.a0.c
    public void a(String str, String str2, Throwable th) {
        if (this.f <= 5) {
            if (th == null) {
                Log.w(h, str + "(" + Thread.currentThread().getName() + "): " + str2);
            } else {
                Log.w(h, str + "(" + Thread.currentThread().getName() + "): " + str2, th);
            }
        }
    }

    @Override // a.c.b.a0.c
    public void a(boolean z) {
        int i;
        if (z) {
            this.g = true;
            i = 2;
        } else {
            this.g = false;
            i = 4;
        }
        this.f = i;
    }

    @Override // a.c.b.a0.c
    public boolean a() {
        return this.g;
    }

    @Override // a.c.b.a0.c
    public void b(String str, String str2) {
        if (this.f <= 6) {
            Log.e(h, str + "(" + Thread.currentThread().getName() + "): " + str2);
        }
    }

    @Override // a.c.b.a0.c
    public void b(String str, String str2, Throwable th) {
        if (this.f <= 6) {
            if (th == null) {
                Log.e(h, str + "(" + Thread.currentThread().getName() + "): " + str2);
            } else {
                Log.e(h, str + "(" + Thread.currentThread().getName() + "): " + str2, th);
            }
        }
    }

    @Override // a.c.b.a0.c
    public void c(String str, String str2) {
        if (this.f <= 2) {
            Log.v(h, str + "(" + Thread.currentThread().getName() + "): " + str2);
        }
    }

    @Override // a.c.b.a0.c
    public void d(String str, String str2) {
        if (this.f <= 5) {
            Log.w(h, str + "(" + Thread.currentThread().getName() + "): " + str2);
        }
    }

    @Override // a.c.b.a0.c
    public void e(String str, String str2) {
        if (this.f <= 3) {
            Log.d(h, str + "(" + Thread.currentThread().getName() + "): " + str2);
        }
    }
}
