diff --git a/app/src/main/java/umc/everyones/lck/presentation/home/HomeViewModel.kt b/app/src/main/java/umc/everyones/lck/presentation/home/HomeViewModel.kt index a14d8608..b7cd31ed 100644 --- a/app/src/main/java/umc/everyones/lck/presentation/home/HomeViewModel.kt +++ b/app/src/main/java/umc/everyones/lck/presentation/home/HomeViewModel.kt @@ -9,6 +9,7 @@ import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.launch +import timber.log.Timber import umc.everyones.lck.data.dto.response.home.HomeTodayMatchResponseDto import umc.everyones.lck.domain.model.response.home.HomeTodayMatchModel import umc.everyones.lck.domain.repository.TestRepository @@ -33,10 +34,10 @@ class HomeViewModel @Inject constructor( // @Inject : 의존성 주입을 받겠 fun fetchHomeTodayMatchInformation(){ viewModelScope.launch { repository.fetchHomeTodayMatchInformation().onSuccess {response -> - Log.d("fetchHomeTodayMatchInformation", response.toString()) + Timber.d("fetchHomeTodayMatchInformation", response.toString()) _matchData.value = response }.onFailure { - Log.d("fetchHomeTodayMatchInformation", it.stackTraceToString()) + Timber.d("fetchHomeTodayMatchInformation", it.stackTraceToString()) _matchData.value = null // 실패시 null 처리 } } diff --git a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckMatchFragment.kt b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckMatchFragment.kt index 8cb2a81e..f0a82fa0 100644 --- a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckMatchFragment.kt +++ b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckMatchFragment.kt @@ -9,6 +9,7 @@ import androidx.lifecycle.Observer import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager import dagger.hilt.android.AndroidEntryPoint +import timber.log.Timber import umc.everyones.lck.R import umc.everyones.lck.databinding.FragmentTodayMatchLckMatchBinding import umc.everyones.lck.domain.model.response.match.TodayMatchInformationModel @@ -37,7 +38,7 @@ class TodayMatchLckMatchFragment : BaseFragment) { diff --git a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckMatchViewModel.kt b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckMatchViewModel.kt index 7f4b68f2..a02ab1a1 100644 --- a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckMatchViewModel.kt +++ b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckMatchViewModel.kt @@ -7,6 +7,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch +import timber.log.Timber import umc.everyones.lck.domain.model.response.match.MatchTodayMatchModel import umc.everyones.lck.domain.model.response.match.TodayMatchInformationModel import umc.everyones.lck.domain.repository.match.TodayMatchRepository @@ -21,10 +22,10 @@ class TodayMatchLckMatchViewModel @Inject constructor( fun fetchTodayMatchInformation(){ viewModelScope.launch { repository.fetchTodayMatchInformation().onSuccess {response -> - Log.d("fetchTodayMatchInformation", response.toString()) + Timber.d("fetchTodayMatchInformation", response.toString()) _matchData.value = response }.onFailure { - Log.d("fetchTodayMatchInformation", it.stackTraceToString()) + Timber.d("fetchTodayMatchInformation", it.stackTraceToString()) _matchData.value = null // 실패 시 null 처리 } } diff --git a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckPogFragment.kt b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckPogFragment.kt index 314ece88..0255d654 100644 --- a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckPogFragment.kt +++ b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckPogFragment.kt @@ -6,6 +6,7 @@ import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import androidx.recyclerview.widget.LinearLayoutManager import dagger.hilt.android.AndroidEntryPoint +import timber.log.Timber import umc.everyones.lck.R import umc.everyones.lck.databinding.FragmentTodayMatchLckPogBinding import umc.everyones.lck.domain.model.response.match.CommonTodayMatchPogModel @@ -26,20 +27,20 @@ class TodayMatchLckPogFragment : BaseFragment(R // 세트 수를 받아와서 탭 레이아웃 설정 viewModel.setCount.observe(viewLifecycleOwner) { setCountModel -> lckPogMatchRVA.updateSetCount(setCountModel.setCount) - Log.d("TodayMatchLckPogFragment", "Set Count: ${setCountModel.setCount}") + Timber.d("TodayMatchLckPogFragment", "Set Count: ${setCountModel.setCount}") } // 각 세트의 POG 데이터를 관찰하여 리사이클러뷰 업데이트 viewModel.setPogData.observe(viewLifecycleOwner) { pogData -> pogData?.let { lckPogMatchRVA.updatePlayers(listOf(CommonTodayMatchPogModel(it.id, it.name, it.profileImageUrl, it.seasonInfo, it.matchNumber, it.matchDate, tabIndex))) - Log.d("TodayMatchLckPogFragment", "Set POG Data: $pogData") + Timber.d("TodayMatchLckPogFragment", "Set POG Data: $pogData") } } // 매치 POG 데이터를 관찰하여 리사이클러뷰 업데이트 viewModel.matchPogData.observe(viewLifecycleOwner) { pogData -> pogData?.let { lckPogMatchRVA.updatePlayers(listOf(CommonTodayMatchPogModel(it.id, it.name, it.profileImageUrl, it.seasonInfo, it.matchNumber, it.matchDate, tabIndex))) - Log.d("TodayMatchLckPogFragment", "Match POG Data: $pogData") + Timber.d("TodayMatchLckPogFragment", "Match POG Data: $pogData") } } // ViewModel의 matchData를 관찰하여 matchId를 가져와서 사용 @@ -63,12 +64,12 @@ class TodayMatchLckPogFragment : BaseFragment(R } else { viewModel.fetchTodayMatchMatchPog(matchId) } - Log.d("TodayMatchLckPogFragment", "Tab selected: $tabIndex") + Timber.d("TodayMatchLckPogFragment", "Tab selected: $tabIndex") } // 세트 수를 가져오기 위해 matchId를 사용 viewModel.fetchTodayMatchSetCount(matchId) - Log.d("TodayMatchLckPogFragment", "Match ID: $matchId") + Timber.d("TodayMatchLckPogFragment", "Match ID: $matchId") viewModel.updateSelectedTab(0) } } @@ -83,7 +84,7 @@ class TodayMatchLckPogFragment : BaseFragment(R setCount = 1, // 초기값 onTabSelected = { tabIndex -> viewModel.updateSelectedTab(tabIndex) - Log.d("frtabIndex", tabIndex.toString()) + Timber.d("frtabIndex", tabIndex.toString()) } ) binding.rvTodayMatchLckPogContainer.layoutManager = LinearLayoutManager(context) diff --git a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckPogViewModel.kt b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckPogViewModel.kt index f2da64b6..841222b5 100644 --- a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckPogViewModel.kt +++ b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchLckPogViewModel.kt @@ -7,6 +7,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch +import timber.log.Timber import umc.everyones.lck.domain.model.request.match.CommonPogModel import umc.everyones.lck.domain.model.response.match.CommonTodayMatchPogModel import umc.everyones.lck.domain.model.response.match.TodayMatchSetCountModel @@ -28,7 +29,7 @@ class TodayMatchLckPogViewModel @Inject constructor( fun updateSelectedTab(tabIndex: Int) { _selectedTabIndex.value = tabIndex - Log.d("tabIndex", tabIndex.toString()) + Timber.d("tabIndex", tabIndex.toString()) } // 세트 수를 저장하는 LiveData private val _setCount = MutableLiveData() @@ -38,10 +39,10 @@ class TodayMatchLckPogViewModel @Inject constructor( fun fetchTodayMatchSetPog(setIndex: Int, matchId: Long) { viewModelScope.launch { repository.fetchTodayMatchSetPog(setIndex, CommonPogModel(matchId)).onSuccess { response -> - Log.d("fetchTodayMatchSetPog", response.toString()) + Timber.d("fetchTodayMatchSetPog", response.toString()) _setPogData.value = response // 데이터를 LiveData에 저장 }.onFailure { - Log.d("fetchTodayMatchSetPog", it.stackTraceToString()) + Timber.d("fetchTodayMatchSetPog", it.stackTraceToString()) } } } @@ -50,10 +51,10 @@ class TodayMatchLckPogViewModel @Inject constructor( fun fetchTodayMatchMatchPog(matchId: Long) { viewModelScope.launch { repository.fetchTodayMatchMatchPog(CommonPogModel(matchId)).onSuccess { response -> - Log.d("fetchTodayMatchMatchPog", response.toString()) + Timber.d("fetchTodayMatchMatchPog", response.toString()) _matchPogData.value = response // 데이터를 LiveData에 저장 }.onFailure { - Log.d("fetchTodayMatchMatchPog", it.stackTraceToString()) + Timber.d("fetchTodayMatchMatchPog", it.stackTraceToString()) } } } @@ -62,10 +63,10 @@ class TodayMatchLckPogViewModel @Inject constructor( fun fetchTodayMatchSetCount(matchId: Long) { viewModelScope.launch { repository.fetchTodayMatchSetCount(matchId).onSuccess { response -> - Log.d("fetchTodayMatchSetCount", response.toString()) + Timber.d("fetchTodayMatchSetCount", response.toString()) _setCount.value = response }.onFailure { - Log.d("fetchTodayMatchSetCount", it.stackTraceToString()) + Timber.d("fetchTodayMatchSetCount", it.stackTraceToString()) } } } diff --git a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchPredictionViewModel.kt b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchPredictionViewModel.kt index 7ce91f53..55ca5719 100644 --- a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchPredictionViewModel.kt +++ b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchPredictionViewModel.kt @@ -10,6 +10,7 @@ import kotlinx.coroutines.launch import org.json.JSONException import org.json.JSONObject import retrofit2.HttpException +import timber.log.Timber import umc.everyones.lck.domain.model.request.match.VoteMatchModel import umc.everyones.lck.domain.model.request.match.VoteMatchPogModel import umc.everyones.lck.domain.model.response.match.CommonVotePogModel @@ -32,10 +33,10 @@ class TodayMatchPredictionViewModel @Inject constructor( fun fetchTodayMatchVoteMatch(matchId: Long) { viewModelScope.launch { repository.fetchTodayMatchVoteMatch(matchId).onSuccess { response -> - Log.d("fetchTodayMatchVoteMatch", response.toString()) + Timber.d("fetchTodayMatchVoteMatch", response.toString()) _matchData.value = response }.onFailure { - Log.d("fetchTodayMatchVoteMatch", it.stackTraceToString()) + Timber.d("fetchTodayMatchVoteMatch", it.stackTraceToString()) } } } @@ -43,10 +44,10 @@ class TodayMatchPredictionViewModel @Inject constructor( fun voteMatch(matchId: Long, teamId: Int) { viewModelScope.launch { repository.voteMatch(VoteMatchModel(matchId, teamId)).onSuccess { response -> - Log.d("voteMatch", response.toString()) + Timber.d("voteMatch", response.toString()) _voteResponse.value = response.message // API에서 전달된 메시지를 ViewModel에 저장 }.onFailure { exception -> - Log.d("voteMatch", exception.stackTraceToString()) + Timber.d("voteMatch", exception.stackTraceToString()) _voteResponse.value = getErrorMessageFromException(exception) // 예외 메시지 처리 } } diff --git a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchTodayPogFragment.kt b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchTodayPogFragment.kt index 409518cb..481923c1 100644 --- a/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchTodayPogFragment.kt +++ b/app/src/main/java/umc/everyones/lck/presentation/match/TodayMatchTodayPogFragment.kt @@ -11,6 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearSnapHelper import androidx.recyclerview.widget.RecyclerView import dagger.hilt.android.AndroidEntryPoint +import timber.log.Timber import umc.everyones.lck.R import umc.everyones.lck.databinding.FragmentTodayMatchTodayPogBinding import umc.everyones.lck.domain.model.response.match.PogPlayerTodayMatchModel @@ -60,7 +61,7 @@ class TodayMatchTodayPogFragment : BaseFragment - Log.d("fetchTodayMatchVoteMatchPog", response.toString()) + Timber.d("fetchTodayMatchVoteMatchPog", response.toString()) _matchPogData.value = response }.onFailure { - Log.d("fetchTodayMatchVoteMatchPog", it.stackTraceToString()) + Timber.d("fetchTodayMatchVoteMatchPog", it.stackTraceToString()) } } } @@ -127,10 +128,10 @@ class TodayMatchTodayPogViewModel @Inject constructor( fun voteSetPog(matchId: Long, setIndex: Int, playerId: Int) { viewModelScope.launch { repository.voteSetPog(VoteSetPogModel(matchId, setIndex, playerId)).onSuccess { response -> - Log.d("voteSetPog", response.toString()) + Timber.d("voteSetPog", response.toString()) _voteResponse.value = "투표 되었습니다!" }.onFailure { exception -> - Log.d("voteSetPog", exception.stackTraceToString()) + Timber.d("voteSetPog", exception.stackTraceToString()) _voteResponse.value = getErrorMessageFromException(exception) } } @@ -139,10 +140,10 @@ class TodayMatchTodayPogViewModel @Inject constructor( fun voteMatchPog(matchId: Long, playerId: Int) { viewModelScope.launch { repository.voteMatchPog(VoteMatchPogModel(matchId, playerId)).onSuccess { response -> - Log.d("voteMatchPog", response.toString()) + Timber.d("voteMatchPog", response.toString()) _voteResponse.value = "투표 되었습니다!" }.onFailure { exception -> - Log.d("voteMatchPog", exception.stackTraceToString()) + Timber.d("voteMatchPog", exception.stackTraceToString()) _voteResponse.value = getErrorMessageFromException(exception) } } @@ -151,10 +152,10 @@ class TodayMatchTodayPogViewModel @Inject constructor( fun fetchTodayMatchSetCount(matchId: Long) { viewModelScope.launch { repository.fetchTodayMatchSetCount(matchId).onSuccess { response -> - Log.d("fetchTodayMatchSetCount", response.toString()) + Timber.d("fetchTodayMatchSetCount", response.toString()) _setCount.value = response }.onFailure { - Log.d("fetchTodayMatchSetCount", it.stackTraceToString()) + Timber.d("fetchTodayMatchSetCount", it.stackTraceToString()) } } }