package a.c.b.a0;

import java.io.PrintStream;

public class b implements c {
    private int f = 4;
    private boolean g = false;

    private synchronized void a(String str, String str2, String str3) {
        String[] split = str2.split("\n");
        int length = split.length;
        for (int i = 0; i < length; i++) {
            System.out.println(System.currentTimeMillis() + " " + Thread.currentThread().getId() + " " + str3 + "/" + str + "(" + Thread.currentThread().getName() + "): " + split[i]);
        }
    }

    private synchronized void a(Throwable th, String str, String str2) {
        if (th != null) {
            StackTraceElement[] stackTrace = th.getStackTrace();
            PrintStream printStream = System.out;
            if (str2.equals("E")) {
                printStream = System.err;
            }
            long id = Thread.currentThread().getId();
            String name = Thread.currentThread().getName();
            printStream.println(System.currentTimeMillis() + " " + id + " " + str2 + "/" + str + "(" + name + "): " + th.toString());
            int length = stackTrace.length;
            for (int i = 0; i < length; i++) {
                printStream.println(System.currentTimeMillis() + " " + id + " " + str2 + "/" + str + "(" + name + "): \tat " + stackTrace[i].toString());
            }
        }
    }

    @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) {
            a(str, str2, "I");
        }
    }

    @Override // a.c.b.a0.c
    public void a(String str, String str2, Throwable th) {
        if (this.f <= 5) {
            a(str, str2, "W");
            a(th, str, "W");
        }
    }

    @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) {
            a(str, str2, "E");
        }
    }

    @Override // a.c.b.a0.c
    public void b(String str, String str2, Throwable th) {
        if (this.f <= 6) {
            a(str, str2, "E");
            a(th, str, "E");
        }
    }

    @Override // a.c.b.a0.c
    public void c(String str, String str2) {
        if (this.f <= 2) {
            a(str, str2, "V");
        }
    }

    @Override // a.c.b.a0.c
    public void d(String str, String str2) {
        if (this.f <= 5) {
            a(str, str2, "W");
        }
    }

    @Override // a.c.b.a0.c
    public void e(String str, String str2) {
        if (this.f <= 3) {
            a(str, str2, "D");
        }
    }
}
