package tooic.fatalityic.redic.speckledic.hankeringic

import android.os.Environment
import tooic.fatalityic.Adventurousic
import com.easy.clean.R
import tooic.fatalityic.redic.speckledic.hankeringic.Curableic.toFormatTime2
import java.io.File

object Halloweenic {
    private val logoDir by lazy(LazyThreadSafetyMode.NONE) {
        val appName = Adventurousic.appContext.resources.getString(R.string.overrodeic)
        val log = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS), "${appName}_logo")
        if (!log.exists()) log.mkdirs()
        log
    }

    fun writeLogFile(key: String, log: String) {
        val logName = key + "_" + System.currentTimeMillis().toFormatTime2() + ".txt"
        val logFile = File(logoDir, logName)
        logFile.createNewFile()
        logFile.writeText(log, Charsets.UTF_8)
    }
}