@file:Suppress("HardCodedStringLiteral")

package eu.gaudian.translator.utils

import android.annotation.SuppressLint
import timber.log.Timber

/**
 * A wrapper around Timber to centralize logging and suppress the
 * "HardcodedText" lint warning for log messages, which are for
 * development purposes only.
 */
@Suppress("unused")
object Log {

    @SuppressLint("HardcodedText")
    fun d(message: String) {
        Timber.d("[DEBUG] $message")
    }

    @SuppressLint("HardcodedText")
    fun d(tag: String, message: String) {
        Timber.tag(tag).d("[DEBUG] $message")
    }

    @SuppressLint("HardcodedText")
    fun d(throwable: Throwable) {
        Timber.d("[DEBUG] ${throwable.message}")
    }



    @SuppressLint("HardcodedText")
    fun d(throwable: Throwable, message: String) {
        Timber.d(throwable, "[DEBUG] $message")
    }

    @SuppressLint("HardcodedText")
    fun d(message: String, throwable: Throwable) {
        Timber.d(throwable, "[DEBUG] $message")
    }

    @SuppressLint("HardcodedText")
    fun i(message: String) {
        Timber.i("[INFO] $message")
    }

    @SuppressLint("HardcodedText")
    fun i(tag : String, message: String) {
        Timber.tag(tag).i("[INFO] $message")
    }

    @SuppressLint("HardcodedText")
    fun w(tag : String, message: String) {
        Timber.tag(tag).w("[WARNING] $message")
    }

    @SuppressLint("HardcodedText")
    fun w(message: String) {
        Timber.w("[WARNING] $message")
    }



    @SuppressLint("HardcodedText", "ThrowableNotAtBeginning")
    fun w(tag : String, message: String, throwable: Throwable?) {
        Timber.tag(tag).w(throwable, "[WARNING] $message")
    }




    @SuppressLint("HardcodedText", "ThrowableNotAtBeginning")
    fun w(message : String, throwable: Throwable) {
        Timber.w("[WARNING] $message", throwable)
    }

    @SuppressLint("HardcodedText", "ThrowableNotAtBeginning")
    fun e(throwable: Throwable, message: String) {
        Timber.e("[ERROR] $message", throwable)
    }

    @SuppressLint("HardcodedText", "ThrowableNotAtBeginning")
    fun e(message: String, throwable: Throwable) {
        Timber.e("[ERROR] $message", throwable)
    }

    @SuppressLint("HardcodedText", "ThrowableNotAtBeginning")
    fun e(message: String) {
        Timber.e("[ERROR] $message")
    }

    @SuppressLint("HardcodedText", "ThrowableNotAtBeginning")
    fun e(throwable: Throwable) {
        Timber.e("[ERROR] ${throwable.message}")
    }

    @SuppressLint("HardcodedText", "ThrowableNotAtBeginning")
    fun e(tag: String, message: String) {
        Timber.tag(tag).e("[ERROR] $message")
    }

    @SuppressLint("HardcodedText", "ThrowableNotAtBeginning")
    fun e(tag: String, message: String, throwable: Throwable?) {
        Timber.tag(tag).e(throwable, "[ERROR] $message")
    }

    @SuppressLint("HardcodedText")
    fun v(message: String) {
        Timber.v("[VERBOSE] $message")
    }

    @SuppressLint("HardcodedText")
    fun v(tag: String, message: String) {
        Timber.tag(tag).v("[VERBOSE] $message")
    }

    @SuppressLint("HardcodedText")
    fun v(throwable: Throwable, message: String) {
        Timber.v(throwable, "[VERBOSE] $message")
    }

    @SuppressLint("HardcodedText")
    fun v(message: String, throwable: Throwable) {
        Timber.v(throwable, "[VERBOSE] $message")
    }

    @SuppressLint("HardcodedText")
    fun wtf(message: String) {
        Timber.wtf("[ASSERT] $message")
    }

    @SuppressLint("HardcodedText")
    fun wtf(tag: String, message: String) {
        Timber.tag(tag).wtf("[ASSERT] $message")
    }

    @SuppressLint("HardcodedText")
    fun wtf(throwable: Throwable) {
        Timber.wtf(throwable, "[ASSERT] ${throwable.message}")
    }

    @SuppressLint("HardcodedText")
    fun wtf(throwable: Throwable, message: String) {
        Timber.wtf(throwable, "[ASSERT] $message")
    }

    @SuppressLint("HardcodedText")
    fun wtf(message: String, throwable: Throwable) {
        Timber.wtf(throwable, "[ASSERT] $message")
    }
}
