package com.rc.core.log

import android.util.Log
import java.util.logging.Level
import java.util.logging.Logger

/**
 * info
 *
 * @author ReiChin_
 */
object RcLog {

    private val logger = Logger.getLogger(RcLog::class.java.name)
    var DE_BUG: Boolean = false
    fun warn(message: String, throwable: Throwable? = null) {
        if (!DE_BUG)return
        printLog(Level.WARNING, message, throwable)
    }

    fun info(message: String, throwable: Throwable? = null) {
        if (!DE_BUG)return
        printLog(Level.INFO, message, throwable)
    }

    private fun printLog(level: Level, message: String, throwable: Throwable? = null) {
        logger.log(level, message, throwable)
    }

}