chore: introduce logger and save log into file

This commit is contained in:
2024-10-07 19:13:51 +08:00
parent 91906d9711
commit b0ae938722
7 files changed
+56 -9

No files matched your search

@@ -0,0 +1,18 @@
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/10/7
*/
package cn.rtast.fancybot.util
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.slf4j.event.Level
object Logger {
inline fun <reified T> getLogger(): Logger {
return LoggerFactory.getLogger(T::class.simpleName).also { it.atLevel(Level.INFO) }
}
}
@@ -31,7 +31,8 @@ fun initCommandAndItem(rob: ROneBotFactory) {
}
fun initFilesDir() {
File("./$ROOT_PATH/caches/images").also { it.mkdirs() }
File("$ROOT_PATH/caches/images").also { it.mkdirs() }
File("$ROOT_PATH/logs").also { it.mkdirs() }
}
fun initSetuIndex() {