package com.avg.zaap.crashlibrary.core.logger;

import android.util.Log;

import com.avg.zaap.crashlibrary.BuildConfig;

/**
 * This class serves as the default logger for the CrashLibrary. This class logs if and only if the
 * library is built in the debug mode.
 * <p/>
 * Created by marek.osvald on 12.4.2016.
 */
public class DefaultLogger implements ILogger {

    @Override
    public void v(final String tag, final String message) {
        if (BuildConfig.DEBUG) {
            Log.v(tag, message);
        }
    }

    @Override
    public void v(final String tag, final String message, final Throwable tr) {
        if (BuildConfig.DEBUG) {
            Log.v(tag, message, tr);
        }
    }

    @Override
    public void d(final String tag, final String message) {
        if (BuildConfig.DEBUG) {
            Log.d(tag, message);
        }
    }

    @Override
    public void d(final String tag, final String message, final Throwable tr) {
        if (BuildConfig.DEBUG) {
            Log.d(tag, message, tr);
        }
    }

    @Override
    public void i(final String tag, final String message) {
        if (BuildConfig.DEBUG) {
            Log.i(tag, message);
        }
    }

    @Override
    public void i(final String tag, final String message, final Throwable tr) {
        if (BuildConfig.DEBUG) {
            Log.i(tag, message, tr);
        }
    }

    @Override
    public void w(final String tag, final String message) {
        if (BuildConfig.DEBUG) {
            Log.w(tag, message);
        }
    }

    @Override
    public void w(final String tag, final Throwable tr) {
        if (BuildConfig.DEBUG) {
            Log.w(tag, tr);
        }
    }

    @Override
    public void w(final String tag, final String message, final Throwable tr) {
        if (BuildConfig.DEBUG) {
            Log.w(tag, message, tr);
        }
    }

    @Override
    public void e(final String tag, final String message) {
        if (BuildConfig.DEBUG) {
            Log.e(tag, message);
        }
    }

    @Override
    public void e(final String tag, final String message, final Throwable tr) {
        if (BuildConfig.DEBUG) {
            Log.e(tag, message, tr);
        }
    }

    @Override
    public void wtf(final String tag, final String message) {
        if (BuildConfig.DEBUG) {
            Log.wtf(tag, message);
        }
    }

    @Override
    public void wtf(final String tag, final Throwable tr) {
        if (BuildConfig.DEBUG) {
            Log.wtf(tag, tr);
        }
    }

    @Override
    public void wtf(final String tag, final String message, final Throwable tr) {
        if (BuildConfig.DEBUG) {
            Log.wtf(tag, message, tr);
        }
    }

}
