mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
commit
c8fca6995c
2
.idea/dataSources.xml
generated
2
.idea/dataSources.xml
generated
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
<data-source source="LOCAL" name="@localhost" uuid="90f8ee11-600e-4155-a316-e8062c7c828b">
|
<data-source source="LOCAL" name="@prod" uuid="90f8ee11-600e-4155-a316-e8062c7c828b">
|
||||||
<driver-ref>mariadb</driver-ref>
|
<driver-ref>mariadb</driver-ref>
|
||||||
<synchronize>true</synchronize>
|
<synchronize>true</synchronize>
|
||||||
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
|
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
|
||||||
|
@ -77,4 +77,8 @@ tasks.withType<Jar> {
|
|||||||
})
|
})
|
||||||
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named<JavaExec>("run") {
|
||||||
|
systemProperty("logback.configurationFile", "logback-debug.xml")
|
||||||
}
|
}
|
@ -19,7 +19,7 @@ object Connector {
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
Database.connect(dataSource)
|
Database.connect(dataSource)
|
||||||
val tables = listOf(Users, Commands, Counters, DailyCounters, PersonalCounters)
|
val tables = listOf(Users, Commands, Counters, DailyCounters, PersonalCounters, Managers)
|
||||||
|
|
||||||
transaction {
|
transaction {
|
||||||
SchemaUtils.createMissingTablesAndColumns(* tables.toTypedArray())
|
SchemaUtils.createMissingTablesAndColumns(* tables.toTypedArray())
|
||||||
|
@ -119,72 +119,75 @@ class MessageHandler(
|
|||||||
var result = chat.first
|
var result = chat.first
|
||||||
var isFail = false
|
var isFail = false
|
||||||
|
|
||||||
result = dailyCounterPattern.replace(result) {
|
// Replace dailyCounterPattern
|
||||||
val name = it.groupValues[1]
|
result = dailyCounterPattern.replace(result) { matchResult ->
|
||||||
|
val name = matchResult.groupValues[1]
|
||||||
val dailyCounter = CounterService.getDailyCounterValue(name, msg.userId, user)
|
val dailyCounter = CounterService.getDailyCounterValue(name, msg.userId, user)
|
||||||
|
|
||||||
return@replace if(dailyCounter.second)
|
if (dailyCounter.second) {
|
||||||
CounterService.updateDailyCounterValue(name, msg.userId, 1, user).first.toString()
|
CounterService.updateDailyCounterValue(name, msg.userId, 1, user).first.toString()
|
||||||
else {
|
} else {
|
||||||
isFail = true
|
isFail = true
|
||||||
dailyCounter.first.toString()
|
dailyCounter.first.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isFail && chat.second != "") {
|
// Handle fail case
|
||||||
|
if (isFail && chat.second.isNotEmpty()) {
|
||||||
result = chat.second
|
result = chat.second
|
||||||
result = dailyCounterPattern.replace(result) {
|
result = dailyCounterPattern.replace(result) { matchResult ->
|
||||||
val name = it.groupValues[1]
|
val name = matchResult.groupValues[1]
|
||||||
val dailyCounter = CounterService.getDailyCounterValue(name, msg.userId, user)
|
val dailyCounter = CounterService.getDailyCounterValue(name, msg.userId, user)
|
||||||
|
|
||||||
dailyCounter.first.toString()
|
dailyCounter.first.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = followPattern.replace(result) {
|
// Replace followPattern
|
||||||
|
result = followPattern.replace(result) { matchResult ->
|
||||||
try {
|
try {
|
||||||
val followingDate = getFollowDate(listener.chatId, msg.userId)
|
val followingDate = getFollowDate(listener.chatId, msg.userId)
|
||||||
.content.streamingProperty.following?.followDate
|
.content.streamingProperty.following?.followDate
|
||||||
|
|
||||||
return@replace when (followingDate) {
|
val period = followingDate?.let {
|
||||||
null -> "0"
|
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
|
||||||
else -> {
|
val pastDate = LocalDateTime.parse(it, formatter)
|
||||||
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
|
val today = LocalDateTime.now()
|
||||||
val pastDate = LocalDateTime.parse(followingDate, formatter)
|
ChronoUnit.DAYS.between(pastDate, today)
|
||||||
val today = LocalDateTime.now()
|
} ?: 0
|
||||||
val period = ChronoUnit.DAYS.between(pastDate, today)
|
|
||||||
|
|
||||||
"$period"
|
period.toString()
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
logger.error(e.message)
|
logger.error(e.message)
|
||||||
"0"
|
"0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = daysPattern.replace(result) {
|
// Replace daysPattern
|
||||||
val (year, month, day) = it.destructured
|
result = daysPattern.replace(result) { matchResult ->
|
||||||
|
val (year, month, day) = matchResult.destructured
|
||||||
val pastDate = LocalDateTime.of(year.toInt(), month.toInt(), day.toInt(), 0, 0, 0)
|
val pastDate = LocalDateTime.of(year.toInt(), month.toInt(), day.toInt(), 0, 0, 0)
|
||||||
val today = LocalDateTime.now()
|
val today = LocalDateTime.now()
|
||||||
|
|
||||||
val daysBetween = ChronoUnit.DAYS.between(pastDate, today)
|
val daysBetween = ChronoUnit.DAYS.between(pastDate, today)
|
||||||
|
|
||||||
daysBetween.toString()
|
daysBetween.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
result = counterPattern.replace(result) {
|
// Replace counterPattern
|
||||||
val name = it.groupValues[1]
|
result = counterPattern.replace(result) { matchResult ->
|
||||||
|
val name = matchResult.groupValues[1]
|
||||||
CounterService.updateCounterValue(name, 1, user).toString()
|
CounterService.updateCounterValue(name, 1, user).toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
result = personalCounterPattern.replace(result) {
|
// Replace personalCounterPattern
|
||||||
val name = it.groupValues[1]
|
result = personalCounterPattern.replace(result) { matchResult ->
|
||||||
|
val name = matchResult.groupValues[1]
|
||||||
CounterService.updatePersonalCounterValue(name, msg.userId, 1, user).toString()
|
CounterService.updatePersonalCounterValue(name, msg.userId, 1, user).toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace namePattern
|
||||||
result = namePattern.replace(result, userName)
|
result = namePattern.replace(result, userName)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -4,11 +4,13 @@ import net.dv8tion.jda.api.JDA
|
|||||||
import net.dv8tion.jda.api.JDABuilder
|
import net.dv8tion.jda.api.JDABuilder
|
||||||
import net.dv8tion.jda.api.entities.Activity
|
import net.dv8tion.jda.api.entities.Activity
|
||||||
import net.dv8tion.jda.api.entities.Guild
|
import net.dv8tion.jda.api.entities.Guild
|
||||||
|
import net.dv8tion.jda.api.events.guild.member.GuildMemberRemoveEvent
|
||||||
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
|
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
|
||||||
import net.dv8tion.jda.api.hooks.ListenerAdapter
|
import net.dv8tion.jda.api.hooks.ListenerAdapter
|
||||||
import space.mori.chzzk_bot.dotenv
|
import space.mori.chzzk_bot.dotenv
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import space.mori.chzzk_bot.discord.commands.*
|
import space.mori.chzzk_bot.discord.commands.*
|
||||||
|
import space.mori.chzzk_bot.services.ManagerService
|
||||||
|
|
||||||
class Discord: ListenerAdapter() {
|
class Discord: ListenerAdapter() {
|
||||||
private lateinit var bot: JDA
|
private lateinit var bot: JDA
|
||||||
@ -22,6 +24,9 @@ class Discord: ListenerAdapter() {
|
|||||||
RegisterCommand,
|
RegisterCommand,
|
||||||
RemoveCommand,
|
RemoveCommand,
|
||||||
UpdateCommand,
|
UpdateCommand,
|
||||||
|
AddManagerCommand,
|
||||||
|
ListManagerCommand,
|
||||||
|
RemoveManagerCommand,
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun onSlashCommandInteraction(event: SlashCommandInteractionEvent) {
|
override fun onSlashCommandInteraction(event: SlashCommandInteractionEvent) {
|
||||||
@ -31,6 +36,10 @@ class Discord: ListenerAdapter() {
|
|||||||
handler?.run(event, bot)
|
handler?.run(event, bot)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onGuildMemberRemove(event: GuildMemberRemoveEvent) {
|
||||||
|
event.member?.let { ManagerService.deleteManager(event.guild.idLong, it.idLong) }
|
||||||
|
}
|
||||||
|
|
||||||
internal fun enable() {
|
internal fun enable() {
|
||||||
val thread = Thread {
|
val thread = Thread {
|
||||||
try {
|
try {
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
package space.mori.chzzk_bot.discord.commands
|
||||||
|
|
||||||
|
import net.dv8tion.jda.api.JDA
|
||||||
|
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.OptionType
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.build.Commands
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.build.OptionData
|
||||||
|
import org.slf4j.LoggerFactory
|
||||||
|
import space.mori.chzzk_bot.discord.CommandInterface
|
||||||
|
import space.mori.chzzk_bot.services.ManagerService
|
||||||
|
import space.mori.chzzk_bot.services.UserService
|
||||||
|
|
||||||
|
object AddManagerCommand : CommandInterface {
|
||||||
|
private val logger = LoggerFactory.getLogger(this::class.java)
|
||||||
|
override val name: String = "addmanager"
|
||||||
|
override val command = Commands.slash(name, "매니저를 추가합니다.")
|
||||||
|
.addOptions(OptionData(OptionType.USER, "user", "추가할 유저를 선택하세요.", true))
|
||||||
|
|
||||||
|
override fun run(event: SlashCommandInteractionEvent, bot: JDA) {
|
||||||
|
val manager = event.getOption("user")?.asUser
|
||||||
|
|
||||||
|
if(manager == null) {
|
||||||
|
event.hook.sendMessage("유저는 필수사항입니다.").queue()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(manager.idLong == event.user.idLong) {
|
||||||
|
event.hook.sendMessage("자신은 매니저로 설정할 수 없습니다.").queue()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val user = UserService.getUser(event.user.idLong)
|
||||||
|
if(user == null) {
|
||||||
|
event.hook.sendMessage("치지직 계정을 찾을 수 없습니다.").queue()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
ManagerService.saveManager(user, manager.idLong, manager.effectiveName)
|
||||||
|
event.hook.sendMessage("등록이 완료되었습니다. ${manager.effectiveName}").queue()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
event.hook.sendMessage("에러가 발생했습니다.").queue()
|
||||||
|
logger.debug(e.stackTraceToString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package space.mori.chzzk_bot.discord.commands
|
||||||
|
|
||||||
|
import net.dv8tion.jda.api.EmbedBuilder
|
||||||
|
import net.dv8tion.jda.api.JDA
|
||||||
|
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.build.Commands
|
||||||
|
import org.slf4j.LoggerFactory
|
||||||
|
import space.mori.chzzk_bot.discord.CommandInterface
|
||||||
|
import space.mori.chzzk_bot.services.ManagerService
|
||||||
|
import space.mori.chzzk_bot.services.UserService
|
||||||
|
|
||||||
|
object ListManagerCommand : CommandInterface {
|
||||||
|
private val logger = LoggerFactory.getLogger(this::class.java)
|
||||||
|
override val name: String = "listmanager"
|
||||||
|
override val command = Commands.slash(name, "매니저 목록을 확인합니다.")
|
||||||
|
|
||||||
|
override fun run(event: SlashCommandInteractionEvent, bot: JDA) {
|
||||||
|
try {
|
||||||
|
val managers = event.guild?.idLong?.let { ManagerService.getAllUsers(it) }
|
||||||
|
|
||||||
|
if(managers == null) {
|
||||||
|
event.channel.sendMessage("여기에서는 사용할 수 없습니다.")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val user = UserService.getUserWithGuildId(event.guild!!.idLong)
|
||||||
|
|
||||||
|
val embed = EmbedBuilder()
|
||||||
|
embed.setTitle("${user!!.username} 매니저 목록")
|
||||||
|
embed.setDescription("매니저 목록입니다.")
|
||||||
|
|
||||||
|
var idx = 1
|
||||||
|
|
||||||
|
managers.forEach {
|
||||||
|
embed.addField("${idx++}", it.lastUserName ?: it.managerId.toString(), true)
|
||||||
|
}
|
||||||
|
|
||||||
|
event.channel.sendMessageEmbeds(embed.build()).queue()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
event.hook.sendMessage("에러가 발생했습니다.").queue()
|
||||||
|
logger.debug(e.stackTraceToString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package space.mori.chzzk_bot.discord.commands
|
||||||
|
|
||||||
|
import net.dv8tion.jda.api.JDA
|
||||||
|
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.OptionType
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.build.Commands
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.build.OptionData
|
||||||
|
import org.slf4j.LoggerFactory
|
||||||
|
import space.mori.chzzk_bot.discord.CommandInterface
|
||||||
|
import space.mori.chzzk_bot.services.ManagerService
|
||||||
|
import space.mori.chzzk_bot.services.UserService
|
||||||
|
|
||||||
|
object RemoveManagerCommand : CommandInterface {
|
||||||
|
private val logger = LoggerFactory.getLogger(this::class.java)
|
||||||
|
override val name: String = "removemanager"
|
||||||
|
override val command = Commands.slash(name, "매니저를 삭제합니다.")
|
||||||
|
.addOptions(OptionData(OptionType.USER, "user", "삭제할 유저를 선택하세요.", true))
|
||||||
|
|
||||||
|
override fun run(event: SlashCommandInteractionEvent, bot: JDA) {
|
||||||
|
val manager = event.getOption("user")?.asUser
|
||||||
|
|
||||||
|
if(manager == null) {
|
||||||
|
event.hook.sendMessage("유저는 필수사항입니다.").queue()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(manager.idLong == event.user.idLong) {
|
||||||
|
event.hook.sendMessage("자신은 매니저로 설정할 수 없습니다.").queue()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val user = UserService.getUser(event.user.idLong)
|
||||||
|
if(user == null) {
|
||||||
|
event.hook.sendMessage("치지직 계정을 찾을 수 없습니다.").queue()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ManagerService.getUser(user.liveAlertGuild ?: 0L, manager.idLong) == null) {
|
||||||
|
event.hook.sendMessage("${manager.name}은 매니저가 아닙니다.")
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
ManagerService.deleteManager(user, manager.idLong)
|
||||||
|
event.hook.sendMessage("삭제가 완료되었습니다. ${manager.effectiveName}").queue()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
event.hook.sendMessage("에러가 발생했습니다.").queue()
|
||||||
|
logger.debug(e.stackTraceToString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
src/main/kotlin/space/mori/chzzk_bot/models/Manager.kt
Normal file
22
src/main/kotlin/space/mori/chzzk_bot/models/Manager.kt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package space.mori.chzzk_bot.models
|
||||||
|
|
||||||
|
import org.jetbrains.exposed.dao.IntEntity
|
||||||
|
import org.jetbrains.exposed.dao.IntEntityClass
|
||||||
|
import org.jetbrains.exposed.dao.id.EntityID
|
||||||
|
import org.jetbrains.exposed.dao.id.IntIdTable
|
||||||
|
|
||||||
|
object Managers: IntIdTable("manager") {
|
||||||
|
val user = reference("user", Users)
|
||||||
|
val managerId = long("manager_id")
|
||||||
|
val discordGuildId = long("discord_guild_id")
|
||||||
|
var lastUserName = varchar("last_user_name", 255).nullable()
|
||||||
|
}
|
||||||
|
|
||||||
|
class Manager(id: EntityID<Int>) : IntEntity(id) {
|
||||||
|
companion object : IntEntityClass<Manager>(Managers)
|
||||||
|
|
||||||
|
var user by User referencedOn Managers.user
|
||||||
|
var managerId by Managers.managerId
|
||||||
|
var discordGuildId by Managers.discordGuildId
|
||||||
|
var lastUserName by Managers.lastUserName
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package space.mori.chzzk_bot.services
|
||||||
|
|
||||||
|
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
||||||
|
import org.jetbrains.exposed.sql.and
|
||||||
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
|
import space.mori.chzzk_bot.models.Manager
|
||||||
|
import space.mori.chzzk_bot.models.Managers
|
||||||
|
import space.mori.chzzk_bot.models.User
|
||||||
|
|
||||||
|
object ManagerService {
|
||||||
|
fun saveManager(user: User, discordId: Long, name: String): Manager {
|
||||||
|
if (user.liveAlertGuild == null)
|
||||||
|
throw RuntimeException("${user.username} has no liveAlertGuild")
|
||||||
|
|
||||||
|
return transaction {
|
||||||
|
Manager.new {
|
||||||
|
this.user = user
|
||||||
|
this.discordGuildId = user.liveAlertGuild!!
|
||||||
|
this.managerId = discordId
|
||||||
|
this.lastUserName = name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateManager(user: User, discordId: Long, name: String): Manager {
|
||||||
|
if (user.liveAlertGuild == null)
|
||||||
|
throw RuntimeException("${user.username} has no liveAlertGuild")
|
||||||
|
|
||||||
|
val manager = getUser(user.liveAlertGuild!!, discordId)
|
||||||
|
|
||||||
|
if (manager == null)
|
||||||
|
throw RuntimeException("$name isn't manager.")
|
||||||
|
manager.lastUserName = name
|
||||||
|
|
||||||
|
return manager
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getUser(guildId: Long, discordId: Long): Manager? {
|
||||||
|
return transaction {
|
||||||
|
val manager = Manager.find(
|
||||||
|
(Managers.discordGuildId eq guildId) and (Managers.managerId eq discordId)
|
||||||
|
)
|
||||||
|
|
||||||
|
manager.firstOrNull()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getAllUsers(guildId: Long): List<Manager> {
|
||||||
|
return transaction {
|
||||||
|
Manager.find(Managers.discordGuildId eq guildId).toList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deleteManager(user: User, discordId: Long): Manager {
|
||||||
|
if (user.liveAlertGuild == null)
|
||||||
|
throw RuntimeException("${user.username} has no liveAlertGuild")
|
||||||
|
return deleteManager(user.liveAlertGuild!!, discordId)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deleteManager(guildId: Long, discordId: Long): Manager {
|
||||||
|
return transaction {
|
||||||
|
val managerRow = Manager.find((Managers.discordGuildId eq guildId) and (Managers.managerId eq discordId)).firstOrNull()
|
||||||
|
|
||||||
|
managerRow ?: throw RuntimeException("Manager not found! $discordId")
|
||||||
|
managerRow.delete()
|
||||||
|
|
||||||
|
managerRow
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -39,6 +39,14 @@ object UserService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getUserWithGuildId(discordGuildId: Long): User? {
|
||||||
|
return transaction {
|
||||||
|
val users = User.find(Users.liveAlertGuild eq discordGuildId)
|
||||||
|
|
||||||
|
users.firstOrNull()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getAllUsers(): List<User> {
|
fun getAllUsers(): List<User> {
|
||||||
return transaction {
|
return transaction {
|
||||||
User.all().toList()
|
User.all().toList()
|
||||||
|
35
src/main/resources/logback-debug.xml
Normal file
35
src/main/resources/logback-debug.xml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<configuration>
|
||||||
|
|
||||||
|
<!-- 콘솔에 출력하는 기본 로그 설정 -->
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>DEBUG</level>
|
||||||
|
</filter>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- HikariCP 로그 레벨 설정 -->
|
||||||
|
<logger name="com.zaxxer.hikari" level="INFO" />
|
||||||
|
<logger name="o.m.jdbc.client.impl.StandardClient" level="INFO" />
|
||||||
|
<logger name="o.m.jdbc.message.server.OkPacket" level="INFO" />
|
||||||
|
<logger name="o.m.jdbc.client.impl.StandardClient" level="INFO" />
|
||||||
|
|
||||||
|
<logger name="com.zaxxer.hikari.HikariConfig" level="WARN" />
|
||||||
|
<logger name="com.zaxxer.hikari.pool.PoolBase" level="WARN" />
|
||||||
|
<logger name="com.zaxxer.hikari.pool.HikariPool" level="WARN" />
|
||||||
|
<logger name="com.zaxxer.hikari.util.DriverDataSource" level="WARN" />
|
||||||
|
|
||||||
|
<!-- Exposed 로그 레벨 설정 -->
|
||||||
|
<logger name="org.jetbrains.exposed" level="INFO" />
|
||||||
|
<logger name="Exposed" level="INFO" />
|
||||||
|
<logger name="org.jetbrains.exposed.sql" level="WARN" />
|
||||||
|
<logger name="org.jetbrains.exposed.sql.transactions" level="WARN" />
|
||||||
|
|
||||||
|
<!-- 루트 로거 설정 -->
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
Loading…
x
Reference in New Issue
Block a user